Skip to content
Qwen Code

Coding agents

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/v1 Endpoint: /v1/chat/completions
Every snippet below follows your choice.

Set it up

  1. Export your API key

    The provider entry below names the variable in envKey, so the key stays out of the file.

    Shell
    export SHANNON_API_KEY=YOUR_API_KEY
  2. Add Shannon to modelProviders

    Put this in ~/.qwen/settings.json. security.auth.selectedType makes Qwen Code start on the OpenAI-compatible route, and model.name must match an id in the list. Window and answer length go inside the provider entry: Qwen Code ignores the top-level model.generationConfig for 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" }
    }
  3. Run Qwen Code

    Start qwen in your project, or pass a prompt to run one task and exit. --yolo approves every tool call, so use it only in a project you can reset.

    Shell
    qwen --yolo "Run the tests, fix what fails, then run them again."
    Qwen Code in a terminal on the Shannon model shannon-coder-1: it fixes two bugs in cat_feeder.py and the three tests pass
    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 idContext windowMax outputImage 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.

SettingValueWhy
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 -p flag still works but is marked deprecated.
  • qwen auth has been removed; the provider comes only from settings.json, environment variables or flags.
  • The Advisor feature asks a second model for advice and sends extra requests. --advisor off turns it off for a run.
  • With --yolo and no sandbox, Qwen Code prints a warning on every headless run. QWEN_CODE_SUPPRESS_YOLO_WARNING=1 hides it.

Tips

  1. List several Shannon ids under modelProviders.openai and switch between them with /model, or pick one for a run with --model <id>.
  2. For a quick test without a settings file, OPENAI_BASE_URL, OPENAI_API_KEY and OPENAI_MODEL work too.
  3. Subagents (the task tool) send their own requests. To keep one request at a time, add "tools": { "exclude": ["task"] }.
  4. --openai-logging writes every request and response to disk, which helps when a request fails.
  5. Our two-bug test took five requests on shannon-coder-1, billed in tokens from API credit.

Troubleshooting

SymptomCauseFix
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.

Choose your language

All languages are equal. Pick the one you want to browse in.

Europe

Middle East & North Africa

South Asia

Southeast Asia

East Asia

Central Asia & Caucasus

Africa

Oceania

Constructed & Classical