Official docs + CLI test · as of 2026-11-10

CodeBuddy models.json: custom models and the right url (November 2026)

Yes. As of 2026-11-10, CodeBuddy's official models.json Configuration Guide says custom models go in user-level ~/.codebuddy/models.json (project level: .codebuddy/models.json under the project root); it currently only supports the OpenAI interface format, and the CLI can also set api to openai-responses. Tested with CodeBuddy Code 2.182.0, QCode works without a Tencent account sign-in: a Chat entry takes the full path https://api.qcode.cc/openai/v1/chat/completions as url, a Responses entry takes https://api.qcode.cc/openai/v1, and the CODEBUDDY_BASE_URL environment variable takes https://api.qcode.cc/openai/v1. All three pass.

Updated 2026-11-10

Point this tool at the QCode endpoint — one key for Claude, GPT and Chinese models.

#CodeBuddy custom model#models.json#OpenAI Chat Completions#Tested on CLI 2.182.0

Four points: official docs and the 2026-11-10 test

No sign-in

Passes on CLI 2.182.0

As of 2026-11-10, tested with CodeBuddy Code 2.182.0: without a Tencent account sign-in, the Chat and Responses entries in models.json and the CODEBUDDY_BASE_URL variable all reach QCode. Use a QCode key starting with cr_; usage is billed per token, with per-model rates on /models.

Full path

Chat url ends in /chat/completions

Official wording: "url field must be the complete interface path, typically ending with /chat/completions", and https://api.openai.com/v1 is listed as an incorrect example. So a QCode Chat entry uses https://api.qcode.cc/openai/v1/chat/completions; stopping at /v1 leaves the request path incomplete.

Responses

With api set, url is only the base

The CLI docs: with api set to openai-responses, requests go to {url}/responses; url takes the base URL, and a trailing /responses is optional. For QCode use https://api.qcode.cc/openai/v1 with a GPT id such as gpt-6.1-terra. The IDE field table has no api field, so Responses entries are for the CLI.

IDE

Same file in the IDE; apiKey is the key itself

The IDE docs use the same file paths and Chat fields and describe apiKey as the "actual key value, not environment variable name"; on the CLI, apiKey and url accept ${VAR_NAME} references. If the IDE and the CLI share one ~/.codebuddy/models.json, write your cr_ key itself in every entry; the CLI accepts that too.

Can CodeBuddy use your own API key?

Yes. As of 2026-11-10, CodeBuddy's official models.json Configuration Guide says custom models live in models.json: user-level ~/.codebuddy/models.json applies to every project, and .codebuddy/models.json under the project root takes priority. It currently only supports the OpenAI interface format API, and the CLI also accepts api set to openai-responses. CodeBuddy is Tencent Cloud's AI coding tool; the Tencent Cloud product overview says it comes in three forms, a plugin, an IDE and a CLI: the plugin installs into VS Code or JetBrains IDEs, CodeBuddy IDE is a standalone IDE, and CodeBuddy Code is the command-line tool (command codebuddy). The models.json path is the same in the codebuddy.cn and codebuddy.ai docs. On QCode this protocol runs GPT and the Chinese families (DeepSeek, GLM, Kimi, Qwen); if you need Claude, use a tool with an Anthropic endpoint, such as Claude Code, ZCode or Qoder, with the same key. WorkBuddy, the office product from the same team, also uses OpenAI Chat Completions but keeps models.json at a different path; see /workbuddy-guide.

As of 2026-11-10: since CLI v2.180.0, custom models send no platform identity headers

The international CLI version history dates v2.180.0 to 2026-11-04 and v2.182.0 to 2026-11-09. The v2.180.0 release notes say custom models no longer carry platform identity request headers: when a custom model connects directly to a third-party endpoint, identity information is no longer sent to the service you configured. The newest entry in the mainland IDE version history is 4.12.4 (2026-11-06), and the documented models.json path is unchanged. As of 2026-11-10, tested with CodeBuddy Code 2.182.0, custom models reach QCode over OpenAI Chat and Responses without a Tencent account sign-in.

Timeline

2026-11-04

The international CLI version history lists v2.180.0; its release notes say custom models no longer carry platform identity request headers.

2026-11-09

The international CLI version history lists v2.182.0, the version used in this page's test.

2026-11-10

Tested with CodeBuddy Code 2.182.0: the Chat full path, Responses at /openai/v1 and CODEBUDDY_BASE_URL all reach QCode, with no Tencent account sign-in at any point.

What the docs state, and what the 2026-11-10 test fills in

What CodeBuddy's docs state

① File locations: user-level ~/.codebuddy/models.json applies to every project; the project level is .codebuddy/models.json under the project root and has higher priority. Configs merge in the order project level, user level, built-in defaults: an entry with the same id is overridden, one with a different id is appended, and a project-level availableModels completely overrides the user level with no merging. ② It currently only supports the OpenAI interface format API; the Chat url must be the complete interface path, typically ending with /chat/completions. ③ Fields: id (required), name, vendor, apiKey, url, maxInputTokens, maxOutputTokens, supportsToolCall, supportsImages and supportsReasoning; the CLI adds api, temperature (0-2) and relatedModels. ④ With api set to openai-responses, the model uses the OpenAI Responses API and requests go to {url}/responses; only an api written explicitly in the model entry switches the protocol. ⑤ On the CLI, apiKey and url accept ${VAR_NAME}, resolved when the CLI starts; if the variable does not exist, the original placeholder is kept and the API call fails. ⑥ Set models.json permissions to 600, and do not commit a config file that holds a real key to version control. ⑦ Config files hot-reload with a 1-second debounce; models added through models.json are tagged custom automatically. ⑧ CLI environment variables: CODEBUDDY_API_KEY is always used in non-interactive mode (-p); CODEBUDDY_BASE_URL overrides the API endpoint address, typically together with CODEBUDDY_API_KEY; CODEBUDDY_MODEL overrides the default agent model.

What the docs leave open, filled in by the 2026-11-10 test

As of 2026-11-10, tested with CodeBuddy Code 2.182.0: ① CODEBUDDY_BASE_URL is an OpenAI Chat base, and the CLI appends /chat/completions to it, so set it to https://api.qcode.cc/openai/v1 and pass a GPT or Chinese model id with --model; this route needs no models.json. ② Neither models.json nor CODEBUDDY_BASE_URL requires a Tencent account sign-in first. ③ A Responses url of https://api.qcode.cc/openai also works; the steps above and the QCode setup docs use https://api.qcode.cc/openai/v1, the same value as CODEBUDDY_BASE_URL. ④ The IDE steps follow the official IDE docs.

IDE and CLI: one models.json, two differences

CodeBuddy IDE (per official docs)

Reads the same ~/.codebuddy/models.json and project-level file. A Chat entry's url is the full path https://api.qcode.cc/openai/v1/chat/completions; apiKey is your cr_ key itself (IDE docs: actual key value, not environment variable name); the field table has no api. In the model dropdown, custom entries carry the custom tag.

CodeBuddy Code CLI (tested on 2.182.0)

Chat entries use the same full path; an entry with api: openai-responses takes only https://api.qcode.cc/openai/v1 as url, with a GPT id; apiKey may be ${QCODE_API_KEY}. You can also skip models.json and set only CODEBUDDY_BASE_URL=https://api.qcode.cc/openai/v1 and CODEBUDDY_API_KEY.

How to point CodeBuddy at QCode

① Install the CLI (skip this if you only use the IDE, which you download from codebuddy.cn or codebuddy.ai): the official prerequisite is Node.js 18.20 or higher; run npm install -g @tencent-ai/codebuddy-code, then check with codebuddy --version (this page's test used 2.182.0). ② Create ~/.codebuddy/models.json and add a Chat entry to the models array: id deepseek-v4-flash, any name, vendor QCode, url https://api.qcode.cc/openai/v1/chat/completions, apiKey ${QCODE_API_KEY} (CLI) or your cr_ key itself (IDE), supportsToolCall true, and maxInputTokens and maxOutputTokens set to what the chosen model supports. ③ For Responses (CLI), add a second entry: id gpt-6.1-terra, api openai-responses, url https://api.qcode.cc/openai/v1, other fields as above. ④ CLI: export QCODE_API_KEY=cr_xxx, then run codebuddy -p with a short prompt and --model set to the entry id; a normal reply means it works. IDE: open the model dropdown, pick the entry tagged custom and send a message. ⑤ As the docs recommend, set the file permissions to 600 and do not commit a file that holds a real key. In mainland China you can replace api.qcode.cc with asia.qcode.cc; the path stays the same.

Run CodeBuddy with a QCode API key

As of 2026-11-10, one QCode API key provides both Anthropic-compatible and OpenAI-compatible endpoints. CodeBuddy custom models use the OpenAI endpoint: a Chat entry's url is the full path https://api.qcode.cc/openai/v1/chat/completions, while Responses entries and CODEBUDDY_BASE_URL use https://api.qcode.cc/openai/v1. On QCode this protocol runs GPT and the Chinese families; common ids are gpt-6.1-sol, gpt-6.1-terra, deepseek-v4-flash, deepseek-v4-pro, glm-5.3, kimi-k3 and qwen3.8-max. Claude models run on the Anthropic endpoint https://api.qcode.cc/api, where the same key works in tools such as Claude Code, ZCode or Qoder. Usage is billed per token, with per-model rates on /models. Three steps: ① register and top up (Alipay and other major payment methods are supported); ② buy a Personal Plan or a Pay-as-you-go Pack and copy your API key, which starts with cr_; ③ write models.json as above; the QCode docs at https://docs.qcode.cc/en/docs/ide/codebuddy have the full JSON and test commands. Not ready for a monthly plan? Pay-as-you-go Packs (/pay-as-you-go) start at $4 for a one-time quota you use within 7 days; if you already have a Personal Plan, add a booster pack when you need more quota.

Frequently asked questions

Where do I configure a custom model in CodeBuddy?

In models.json. User-level ~/.codebuddy/models.json applies to every project, .codebuddy/models.json under the project root takes priority, and the IDE and the CLI read the same paths. As of 2026-11-10, every field is listed in the official models.json Configuration Guide; the file hot-reloads with a 1-second debounce, so no restart is needed after saving.

Does the models.json url need /chat/completions?

For Chat entries, yes. Official wording: "url field must be the complete interface path, typically ending with /chat/completions", and https://api.openai.com/v1 is listed as an incorrect example, so QCode takes https://api.qcode.cc/openai/v1/chat/completions. An entry with api: openai-responses works the other way: url is the base (https://api.qcode.cc/openai/v1), requests go to {url}/responses, and a trailing /responses is optional. If you get a 404, first check that the Chat url reaches /chat/completions.

Do I have to sign in before a CodeBuddy custom model works?

No. As of 2026-11-10, tested with CodeBuddy Code 2.182.0, both models.json and CODEBUDDY_BASE_URL reach QCode and return answers without a Tencent account sign-in. IDE setup follows the official IDE docs. The v2.180.0 release notes also say custom models no longer carry platform identity request headers.

Can CodeBuddy use Claude or GPT?

GPT and the Chinese models, yes. CodeBuddy custom models use the OpenAI interface, and on QCode this protocol runs GPT plus DeepSeek, GLM, Kimi and Qwen: Chat entries can use gpt-6.1-sol, deepseek-v4-flash, glm-5.3, kimi-k3 or qwen3.8-max, and CLI Responses entries can use gpt-6.1-terra. Claude models run on QCode's Anthropic endpoint https://api.qcode.cc/api; when you need Claude, use a tool that supports it, such as Claude Code, ZCode or Qoder, with the same key.

How do I set CODEBUDDY_BASE_URL?

Set it to https://api.qcode.cc/openai/v1, set CODEBUDDY_API_KEY to your QCode key starting with cr_, and pass a GPT or Chinese model id with --model. As of 2026-11-10, tested with CodeBuddy Code 2.182.0, this variable is an OpenAI Chat base and the CLI appends /chat/completions, so this route needs no models.json; with https://api.qcode.cc/api the request goes to /api/chat/completions and QCode answers HTTP 400. Official notes: CODEBUDDY_BASE_URL overrides the API endpoint address, typically together with CODEBUDDY_API_KEY; CODEBUDDY_MODEL overrides the default agent model.

Is CodeBuddy's models.json the same as WorkBuddy's?

The paths differ. WorkBuddy's official text says it shares one foundation with CodeBuddy, the coding product. The mainland app keeps its config locally in workbuddy/models.json and says custom models already set in ~/.codebuddy/models.json keep working after the UI upgrade; the international default file is ~/.workbuddy-ai/models.json. WorkBuddy custom models also use OpenAI Chat Completions, so a hand-written url is the same full path https://api.qcode.cc/openai/v1/chat/completions; menus and steps are on /workbuddy-guide.

Sources

CodeBuddy: the models.json Configuration Guide on codebuddy.cn and codebuddy.ai (IDE and CLI), the CLI environment-variable and install pages, the CLI v2.180.0 release notes and international version history, the mainland IDE version history, and the Tencent Cloud CodeBuddy product overview; WorkBuddy: the model configuration pages on workbuddy.cn and workbuddy.ai and workbuddy.cn/llms.txt. All checked on 2026-11-10. QCode: the Endpoints & API Paths docs, the CodeBuddy setup docs and the live ids on qcode.cc/models. CLI test: CodeBuddy Code 2.182.0, 2026-11-10.

Run CodeBuddy on your own key

Put one QCode API key in CodeBuddy's models.json: OpenAI Chat for GPT and Chinese models, CLI Responses for GPT; billed per token, with per-model rates on /models.

Not sure where to start?

Try it for a week

Small Pack: $4 for $30 of quota, valid 7 days

Use it every day

Starter: $9.00/month with $5 of quota every day — just $0.060 per $1 of quota, vs about $0.113 for the Medium Pack