Skip to content
Kimi Code CLI

Coding agents

Use Kimi Code CLI with Shannon

Add Shannon as an openai provider in Kimi Code's config.toml and run the agent on Shannon models.

  • Tested Nov 7, 2026
  • OpenAI Chat Completions
  • About 3 min

About Kimi Code CLI

Kimi Code CLI is Moonshot AI's coding agent. It runs in the terminal, in editors through the Agent Client Protocol, and as a local web app. It reads and edits files, runs commands and can hand work to sub-agents. Its config takes any OpenAI-compatible provider, so it runs on Shannon models as well as Moonshot's own.

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. Install Kimi Code

    Shell
    npm install -g @moonshot-ai/kimi-code
  2. Add Shannon in config.toml

    Edit ~/.kimi-code/config.toml (Kimi Code creates it on first start). api_key_env names the variable that holds the key. max_context_size is required, and a model Kimi Code does not know needs its capabilities listed, or it gets no tools.

    ~/.kimi-code/config.toml
    default_model = "Kimi-K3-uncensored-NVFP4"
    
    [providers.shannon]
    type = "openai"
    base_url = "https://api.shannon-ai.com/v1"
    api_key_env = "SHANNON_API_KEY"
    
    [models."Kimi-K3-uncensored-NVFP4"]
    provider = "shannon"
    model = "Kimi-K3-uncensored-NVFP4"
    max_context_size = 1022976
    max_output_size = 262144
    capabilities = ["tool_use", "thinking", "image_in"]
  3. Export the key and run Kimi Code

    kimi doctor checks the config file. kimi opens a session; kimi -p runs one prompt and prints the result.

    Shell
    export SHANNON_API_KEY=YOUR_API_KEY
    kimi doctor
    kimi -p "Run the tests, fix what fails, then run them again."
    Kimi Code CLI in a terminal on the Shannon model shannon-coder-1: reasoning lines, failing tests, two fixes and the tests passing
    A real run on Kimi Code CLI 2.5.2 in print mode: reasoning, tool calls and all tests passing.

Check that it works

Send: What does this project do?

You should see: Kimi Code reads your files and answers; /model shows the Shannon alias.

Models that fit Kimi Code CLI

Every id below meets what Kimi Code CLI 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

Kimi Code CLI asks for these values. They follow the model you picked.

SettingValueWhy
max_context_size 1022976 Required. Kimi Code compacts before it.
max_output_size 262144 The longest answer.

Good to know

  • Kimi Code does not read keys from the shell on its own: export OPENAI_API_KEY does nothing. Name the variable in api_key_env, or write api_key in the file (one of the two, not both).
  • -p cannot be combined with --auto. Print mode runs tool calls without asking.
  • Reasoning from the model is shown as lines that start with • before the answer.
  • Quote a model alias that contains a dot, such as [models."Kimi-K3.1-Pro-uncensored-NVFP4"].

Tips

  1. Add one [models.…] block per Shannon id and switch with /model, or per run with kimi -m <alias>.
  2. Sub-agents (the Agent tool) send their own requests. An agent file with disallowedTools: [Agent], passed with --agent-file, keeps a run to one request at a time.
  3. Agent swarms start only after you turn on /swarm; they never start in kimi -p.
  4. kimi -r <session> resumes a print-mode run; the id is printed at the end.
  5. Our two-bug test took four requests on shannon-coder-1.

Troubleshooting

SymptomCauseFix
Error naming SHANNON_API_KEY at start api_key_env points at a variable that is empty in this shell. Export the key in the shell that starts kimi.
The agent answers but never runs tools capabilities lacks tool_use. Add capabilities = ["tool_use"] to the model block.
404 Not Found base_url lacks /v1. Use https://api.shannon-ai.com/v1.
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 Kimi Code CLI work with Shannon?

Yes, as a provider of type openai with the base URL https://api.shannon-ai.com/v1.

Can Kimi Code use Kimi models on Shannon?

Yes: add a model block for a Kimi id from GET /v1/models, such as Kimi-K3-uncensored-NVFP4, with the same provider.

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