What is Qwen Code
Qwen Code is an open-source coding agent for the terminal. Its modelProviders setting lists the models you can use and the API protocol of each. This setup adds Capriole AI models to that list.
Prerequisites
Before you begin, make sure you have:
Installation
Install Qwen Code with npm (Node.js 22 or later):
Or install it with Homebrew:
Verify the install:
Configuration
Model validation
Qwen Code 0.25.3 passes a file-read, file-write, and final-answer check through Capriole AI with every model in Supported models, using the configuration below.
Put your key in ~/.qwen/.env:
Create or update ~/.qwen/settings.json:
What each setting does:
- Models under
openai use Chat Completions. GPT models add wireApi: "responses" to use the Responses API.
- Models under
anthropic use Anthropic Messages. Their baseUrl has no /v1.
envKey names the environment variable that holds your key. Qwen Code sends the key as a Bearer token to Capriole AI.
contextWindowSize tells Qwen Code each model’s context window.
security.auth.selectedType and model.name set the default model. /model updates both when you switch.
Run Qwen Code
Start Qwen Code from your project directory:
Switch models with /model. For a one-shot run, pass the prompt, the model, and the auth type of its group:
Supported models
openai-latest and claude-latest always point to our latest flagship in each family.
Troubleshooting
Why does Qwen Code return an authentication error?
Confirm that ~/.qwen/.env sets CAPRIOLE_AI_API_KEY, or export the variable in the same shell.
Why does a model fail with a protocol error?
Run the model with the auth type of its group: --auth-type openai for models under openai, and --auth-type anthropic for models under anthropic. /model sets this for you.
Why do Claude requests fail with Unsupported Claude Messages model?
Claude models under anthropic need the bare Claude IDs, such as claude-opus-5-5.
Notes
- Keep your key in
~/.qwen/.env, not in settings.json.
- To add another Capriole AI model, copy the entry of a model from the same family and change the ID.
GET https://api.caprioletech.com/v1/models lists every model ID.
- Official references: Qwen Code and Qwen Code model providers.
Last modified on October 20, 2026