Use Qwen Code with Shannon
Add Shannon to modelProviders in Qwen Code's settings.json and the agent reads, edits and tests your code on Shannon models.
- Tested Nov 7, 2026
- OpenAI Chat Completions
- About 3 min
About Qwen Code
Qwen Code is an open-source coding agent for the terminal, built by the Qwen team on the Gemini CLI code base. Developers use it to read a repository, run commands and edit files from one prompt. With Shannon it runs on any Shannon model that calls tools, through the OpenAI-compatible provider it already has.
What you need
- A Shannon API key
- Keys & usage
- Base URL
-
https://api.shannon-ai.com/v1Endpoint:/v1/chat/completions - Every snippet below follows your choice.
Set it up
-
Export your API key
The provider entry below names the variable in
envKey, so the key stays out of the file.Shellexport SHANNON_API_KEY=YOUR_API_KEY -
Add Shannon to modelProviders
Put this in
~/.qwen/settings.json.security.auth.selectedTypemakes Qwen Code start on the OpenAI-compatible route, andmodel.namemust match anidin the list. Window and answer length go inside the provider entry: Qwen Code ignores the top-levelmodel.generationConfigfor provider models.~/.qwen/settings.json{ "modelProviders": { "openai": [ { "id": "Kimi-K3-uncensored-NVFP4", "name": "Kimi-K3-uncensored-NVFP4", "baseUrl": "https://api.shannon-ai.com/v1", "envKey": "SHANNON_API_KEY", "generationConfig": { "contextWindowSize": 1022976, "samplingParams": { "max_tokens": 262144 } } } ] }, "security": { "auth": { "selectedType": "openai" } }, "model": { "name": "Kimi-K3-uncensored-NVFP4" } } -
Run Qwen Code
Start
qwenin your project, or pass a prompt to run one task and exit.--yoloapproves every tool call, so use it only in a project you can reset.Shellqwen --yolo "Run the tests, fix what fails, then run them again."
A real run on Qwen Code 0.26.9: shell and edit tool calls, both bugs fixed, all tests passing.
Check that it works
Send: What does this project do?
You should see: Qwen Code reads your files and answers; /model shows the Shannon id.
Models that fit Qwen Code
Every id below meets what Qwen Code needs. The first one is the default in the snippets.
| Model id | Context window | Max output | Image input |
|---|---|---|---|
Kimi-K3-uncensored-NVFP4 | 1,022,976 | 262,144 | Yes |
shannon-coder-1 | 131,072 | 65,536 | No |
Kimi-K3.1-Pro-uncensored-NVFP4 | 1,022,976 | 262,144 | Yes |
Kimi-K3-uncensored-3BIT-REAP | 225,280 | 225,280 | Yes |
shannon-3 | 196,608 | 65,536 | Yes |
Model settings
Qwen Code asks for these values. They follow the model you picked.
| Setting | Value | Why |
|---|---|---|
contextWindowSize | 1022976 | Qwen Code compacts the conversation before this many tokens. |
samplingParams.max_tokens | 262144 | The longest answer. |
Good to know
- A one-shot prompt is now a plain argument:
qwen "…". The-pflag still works but is marked deprecated. qwen authhas been removed; the provider comes only fromsettings.json, environment variables or flags.- The Advisor feature asks a second model for advice and sends extra requests.
--advisor offturns it off for a run. - With
--yoloand no sandbox, Qwen Code prints a warning on every headless run.QWEN_CODE_SUPPRESS_YOLO_WARNING=1hides it.
Tips
- List several Shannon ids under
modelProviders.openaiand switch between them with/model, or pick one for a run with--model <id>. - For a quick test without a settings file,
OPENAI_BASE_URL,OPENAI_API_KEYandOPENAI_MODELwork too. - Subagents (the
tasktool) send their own requests. To keep one request at a time, add"tools": { "exclude": ["task"] }. --openai-loggingwrites every request and response to disk, which helps when a request fails.- Our two-bug test took five requests on
shannon-coder-1, billed in tokens from API credit.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
401 | SHANNON_API_KEY is not set in the shell that starts Qwen Code. | Export it, or put it under "env" in settings.json as a fallback. |
404 Not Found | baseUrl is missing /v1 or ends in /chat/completions. | Use exactly https://api.shannon-ai.com/v1. |
| Qwen Code asks you to sign in | security.auth.selectedType is not openai, or model.name matches no id. | Set both as in the example. |
401 Unauthorized | The key is missing, mistyped or rotated. | Copy the key again from Keys & usage; it starts with sk-. |
context_length_exceeded / "prompt is too long" | The conversation is longer than the model's window. | Start a new chat, let the tool compact it, or pick a model with a larger window. |
insufficient_quota | Your balance cannot pay for the request. | Top up or change plan; the request is not retried by itself. |
Questions
Does Qwen Code work with Shannon?
Yes, as an OpenAI-compatible model provider with the base URL https://api.shannon-ai.com/v1.
Which model should Qwen Code use?
A model with tool calls, such as shannon-coder-1, which we tested it with, or a long-window model for large repositories.