Overview
CodeBuddy and WorkBuddy are AI-powered coding assistants developed by Tencent Cloud that integrate directly into your IDE. By connecting them to FoxAPI, you can leverage a wide selection of AI models through FoxAPI’s unified API.CodeBuddy and WorkBuddy use a
models.json configuration file to define custom model providers. FoxAPI’s OpenAI-compatible endpoint works seamlessly with this configuration method.Prerequisites
FoxAPI API Key
An active FoxAPI API key with access to the models you want to use.
CodeBuddy / WorkBuddy
The CodeBuddy or WorkBuddy extension installed in your IDE (VS Code, JetBrains, etc.).
Configuration
CodeBuddy and WorkBuddy read model definitions from amodels.json file. There are two levels of configuration:
- User-level (applies to all projects): stored in your home directory
- Project-level (higher priority, applies to a single project): stored in the project root
Locate the Configuration File
Choose the appropriate path based on your tool and operating system:
- CodeBuddy
- WorkBuddy
| Level | macOS / Linux | Windows |
|---|---|---|
| User | ~/.codebuddy/models.json | C:\Users\<username>\.codebuddy\models.json |
| Project | <project-root>/.codebuddy/models.json | <project-root>\.codebuddy\models.json |
Create the models.json File
Create the Replace
models.json file at the path from the previous step. Here is a basic example with one model:sk-your-foxapi-api-key with your actual FoxAPI API key.Add More Models (Optional)
You can define multiple models in the Refer to FoxAPI’s model list for all available model IDs.
models array. Each entry appears as a selectable model in the extension:Configuration Reference
Each model entry inmodels.json supports the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The model identifier sent to the API (e.g., gpt-4o, claude-sonnet-4-20250514). |
name | string | Yes | Display name shown in the model selector. |
vendor | string | Yes | A label for the provider (e.g., FoxAPI). |
apiKey | string | Yes | Your FoxAPI API key. |
url | string | Yes | The full chat completions endpoint URL. |
supportsToolCall | boolean | No | Set to true if the model supports function/tool calling. |
supportsImages | boolean | No | Set to true if the model supports image inputs. |
Verify the Connection
After configuringmodels.json:
- Open any code file in your IDE.
- Select one of your FoxAPI models from the model dropdown.
- Trigger the AI assistant (e.g., select code and ask for an explanation, or start an inline chat).
- If the response is generated successfully, the connection is working.
Troubleshooting
No response from the AI assistant
No response from the AI assistant
- Verify your API key is correct and has sufficient balance.
- Check that the
urlfield is exactlyhttps://api.foxapi.cc/v1/chat/completions. - Ensure the
idfield matches a model available on FoxAPI. - Validate the JSON syntax of your
models.jsonfile (no trailing commas, proper quoting).
Models not appearing in the dropdown
Models not appearing in the dropdown
- Confirm the
models.jsonfile is in the correct directory (see Locate the Configuration File). - The extension auto-detects file changes, but try restarting the extension or IDE if models still do not appear.
- Ensure the JSON file is valid. You can check with:
Slow response times
Slow response times
- Try switching to a faster model (e.g.,
claude-sonnet-4-20250514instead ofclaude-opus-4-20250514). - Check your network connection.
Tool calling or image features not working
Tool calling or image features not working
- Ensure
supportsToolCalland/orsupportsImagesare set totruein your model entry. - Not all models support these features. Check the model’s capabilities on FoxAPI’s model list.
Security Best Practices
- Never commit
models.jsonto version control if it contains your API key. Add.codebuddy/and.workbuddy/to your.gitignorefile. - Use project-level config with caution. If working in a shared repository, prefer user-level configuration to avoid accidentally exposing your API key.
- Monitor usage on your FoxAPI dashboard to detect any unexpected consumption.