CodeBuddy Custom Models: Claude & GPT
This guide needs an API key
Create an account and generate one in about a minute, then use it wherever the steps below expect a key.
No card required to sign up · API usage requires a top-up
CodeBuddy is Tencent Cloud's AI code editor; its models.json accepts full OpenAI-compatible endpoints, so one Code By AI key serves Claude and GPT.
CodeBuddy reads custom models from ~/.codebuddy/models.json (user level) or <workspace>/.codebuddy/models.json (project level). Project entries override user entries with the same id; the file hot-reloads about a second after you save.
One command (macOS / Linux)
1 curl -fsSL https://www.codebyai.net/setup.sh | sh -s -- --codebuddy
It asks for your API key (hidden input), adds gpt-5.6-terra and claude-sonnet-5 to the user-level ~/.codebuddy/models.json, backs up the file, and leaves it owner-only. CodeBuddy reloads the file by itself; pick either model in the model picker. Re-running rotates the key; | sh -s -- --uninstall restores the file. A project-level .codebuddy/models.json that defines the same id still wins over these entries. The CodeBuddy plugin does not read models.json; use the IDE or CLI. The manual steps below do the same by hand.
1. Create a Code By AI API key
Sign in to Code By AI, open API Keys, and create a key. It looks like sk-proj-....
2. Edit models.json
Open ~/.codebuddy/models.json and merge this into the existing object. Keep any models already there:
1 {2 "models": [3 {4 "id": "gpt-5.6-terra",5 "name": "CodeByAI GPT",6 "vendor": "Custom",7 "url": "https://www.codebyai.net/api/agent/v1/chat/completions",8 "apiKey": "sk-proj-xxxx",9 "maxInputTokens": 200000,10 "maxOutputTokens": 65536,11 "supportsToolCall": true,12 "supportsImages": false,13 "supportsReasoning": false14 },15 {16 "id": "claude-sonnet-5",17 "name": "CodeByAI Claude",18 "vendor": "Custom",19 "url": "https://www.codebyai.net/api/agent/v1/chat/completions",20 "apiKey": "sk-proj-xxxx",21 "maxInputTokens": 200000,22 "maxOutputTokens": 65536,23 "supportsToolCall": true,24 "supportsImages": false,25 "supportsReasoning": false26 }27 ]28 }
CodeBuddy only speaks the OpenAI interface format, so url must be the complete Chat Completions path. Claude IDs still work: the gateway forwards claude-* to the Claude channel and bills Claude prices.
3. Select the model
Save the file. CodeBuddy reloads it automatically; open the model picker and choose CodeByAI GPT or CodeByAI Claude. If you maintain availableModels, add both IDs there, otherwise the list is ignored and every configured model is shown.
Model fields
maxInputTokensandmaxOutputTokensshould match the model's real limits; 200,000 and 65,536 are the values the gateway's models use.supportsToolCallmust staytruefor agent tasks.supportsImagesandsupportsReasoningare optional; enable them only when the selected model supports image input or reasoning parameters.
Troubleshooting
404—urlis a base URL or ends somewhere other than/chat/completions. Use the fullhttps://www.codebyai.net/api/agent/v1/chat/completions.401/ invalid key — the key has stray spaces, was deleted, or expired. Create a new one on the API Keys page.- Insufficient balance — top up on the Wallet page.
- The model is hidden — a non-empty
availableModelslist does not include its ID. Add it or remove the list. - The file is ignored — invalid JSON stops the reload. CodeBuddy's file is plain JSON; remove comments and trailing commas.
Get started
Four steps to your first request
- 01
Create a free account
Sign up with Google, GitHub or email and set a password. No card is required.
- 02
Generate an API key
Create a key in one click from the dashboard. It lets your CLI authenticate with Code By AI.
- 03
Top up your balance
Add credit before your first request; usage is charged per token from your balance.
- 04
Point your CLI at Code By AI
Export one base-URL variable, or add a model provider block to config.toml. The setup guides list the exact lines for each agent.
No card required to sign up · API usage requires a top-up