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/v1Endpoint:/v1/chat/completions - Every snippet below follows your choice.
Set it up
-
Install Kimi Code
Shellnpm install -g @moonshot-ai/kimi-code -
Add Shannon in config.toml
Edit
~/.kimi-code/config.toml(Kimi Code creates it on first start).api_key_envnames the variable that holds the key.max_context_sizeis required, and a model Kimi Code does not know needs itscapabilitieslisted, or it gets no tools.~/.kimi-code/config.tomldefault_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"] -
Export the key and run Kimi Code
kimi doctorchecks the config file.kimiopens a session;kimi -pruns one prompt and prints the result.Shellexport SHANNON_API_KEY=YOUR_API_KEY kimi doctor kimi -p "Run the tests, fix what fails, then run them again."
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 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
Kimi Code CLI asks for these values. They follow the model you picked.
| Setting | Value | Why |
|---|---|---|
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_KEYdoes nothing. Name the variable inapi_key_env, or writeapi_keyin the file (one of the two, not both). -pcannot 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
- Add one
[models.…]block per Shannon id and switch with/model, or per run withkimi -m <alias>. - Sub-agents (the
Agenttool) send their own requests. An agent file withdisallowedTools: [Agent], passed with--agent-file, keeps a run to one request at a time. - Agent swarms start only after you turn on
/swarm; they never start inkimi -p. kimi -r <session>resumes a print-mode run; the id is printed at the end.- Our two-bug test took four requests on
shannon-coder-1.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
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.