Roo Code Setup
Use QCode.cc from the Roo Code VS Code extension: pick the Anthropic provider, tick the custom base URL, and Claude works
Roo Code Setup¶
Roo Code is an open-source AI coding extension for VS Code, forked from Cline; Kilo Code in turn forked from it — the three share nearly identical settings screens, so this page transfers between them.
Which protocol¶
| Model you want | API Provider | Base URL |
|---|---|---|
| Claude | Anthropic |
https://api.qcode.cc/api |
| GPT / the four Chinese families | OpenAI Compatible |
https://api.qcode.cc/openai/v1 |
🔴 Do not use OpenAI Compatible to reach Claude — QCode's OpenAI endpoint rejects Claude models with model_not_available_on_endpoint. See Endpoints & API Paths.
Install¶
Search for Roo Code in the VS Code marketplace, or follow the instructions in the project repository.
Configure Claude (Anthropic provider)¶
- Open Settings (gear icon) in the Roo Code sidebar
- Set API Provider to Anthropic
- Put your QCode key (starts with
cr_) in API Key - Tick Use custom base URL and enter
https://api.qcode.cc/api - Choose
claude-sonnet-5(or another live id) in the model dropdown - Save, then send a message in the chat box to confirm
From mainland China, swap the host for
https://asia.qcode.cc/api(Hong Kong node); the key is unchanged. No trailing slash on the base URL — the extension appends/v1/messagesitself, and an extra slash produces a 404.
Configure GPT and Chinese models (OpenAI Compatible)¶
- Set API Provider to OpenAI Compatible
- Base URL:
https://api.qcode.cc/openai/v1 - API Key: the same
cr_key - Model ID:
gpt-5.5,gpt-5.6-terra, or a Chinese id such asglm-5.2
Verify connectivity¶
Check the endpoint and key with curl first, so you know whether to debug the extension's UI:
KEY="cr_your_qcode_key"
curl -X POST https://api.qcode.cc/api/v1/messages \
-H "x-api-key: $KEY" -H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet-5","max_tokens":32,"messages":[{"role":"user","content":"ping"}]}'
JSON containing content means the endpoint side is fine; if the extension still fails, the problem is in its settings.
Troubleshooting¶
| Symptom | Cause | Fix |
|---|---|---|
model_not_available_on_endpoint |
Reaching Claude through OpenAI Compatible | Switch to the Anthropic provider with /api |
Invalid API key |
Wrong key or stray whitespace | Check the cr_ prefix and trim spaces |
| 404 | Trailing slash on the base URL, or wrong path | Compare against the table above |
| Your model id is missing from the dropdown | Not in the extension's built-in list | Type it into the custom model id field |
Related¶
- Endpoints & API Paths — protocol × model-family table
- Kilo Code Setup — downstream fork, nearly identical setup
- Cline Integration — upstream project
- Chinese Models