Integration · Agent
Use other models in Kimi Code CLI
Kimi Code CLI is Moonshot AI’s terminal agent and reads providers and models from a TOML config. AutoJev adds one autojev provider plus a model entry for each model or route you select, then routes every request to the provider behind it.
- Edits ~/.kimi-code/config.toml (or ~/.kimi)
- One provider, one entry per selection
- Chat Completions in, any protocol out
- Original TOML restored on disconnect
Agents
CodexResponses
~/.codex/config.toml
Claude CodeMessages
~/.claude/settings.json
Gemini CLIGemini
~/.gemini/settings.json
OpenCodeChat
~/.config/opencode/opencode.json
How AutoJev connects Kimi Code CLI
Kimi Code CLI lets you define providers and models in config.toml. On connect, AutoJev adds [providers.autojev] with type openai and the gateway URL http://127.0.0.1:9527/v1, then writes a [models."<id>"] table for every model and route you selected, each pointing at that provider. default_model is set to your chosen default.
Kimi Code CLI then talks Chat Completions to AutoJev, and AutoJev forwards each request to the real upstream — Kimi’s own API through an OpenAI-compatible endpoint, DeepSeek, OpenRouter, a local model or a route that picks between them — converting protocols where needed.
What AutoJev configures
What Kimi Code CLI gains from the gateway
One place for keys
Provider keys live in AutoJev on your machine. Kimi Code CLI only holds a placeholder key, and requests go directly to your providers with no markup.
Failover before output
On connection errors or HTTP 401/402/403/408/429/5xx before output starts, a route retries another candidate (up to 4 attempts by default) and respects Retry-After.
Per-agent logs and cost
Every request is labeled kimi, with model, route, input/output/cache tokens, latency and estimated cost. Prompts and responses are not stored.
Routing without edits
Connect a route once. Switch its strategy between load balancing and intelligent selection in AutoJev without touching Kimi Code CLI’s config again.
Set up Kimi Code CLI with AutoJev
- 1
Install AutoJev
Download the desktop app and open it; the gateway runs on http://127.0.0.1:9527.
- 2
Add providers and models
Add any OpenAI-compatible endpoint (for example Moonshot’s), DeepSeek, OpenRouter, Ollama or an Anthropic-compatible endpoint with your key, test it and add models.
- 3
Optional: create a route
Group models into a route such as autojev/fast to let AutoJev choose, balance or fail over between them.
- 4
Connect Kimi
On Agents, AutoJev detects the kimi executable. Select models and routes, choose the default and click Connect.
- 5
Start Kimi Code CLI
Start a new session; requests appear in AutoJev Logs under kimi.
bash
The config AutoJev writes
Example with the route autojev/fast as default. Each extra selection adds another [models."<id>"] table.
Switching models and routes
All your selections are present as model entries, so you can switch between them in Kimi Code CLI. To add, remove or change the default, update the Agents page and reconnect, or use “Batch update configurations”. On each update, AutoJev removes the model entries it owns and writes the new set; your own models are untouched. If one of your existing model IDs collides with an AutoJev entry, AutoJev refuses to overwrite it.
Restoring config.toml
AutoJev validates the TOML before writing and keeps a backup. Disconnect, “Stop and restore configurations” or quitting from the tray reverts the default model, provider and model entries it added, while keeping non-conflicting edits you made later.
See every Kimi request
Requests are labeled by agent, so you can filter Logs to kimi and check model, route, tokens, latency and estimated cost.
Logs
Frequently asked questions
Can Kimi Code CLI use non-Kimi models?
Yes. With AutoJev connected, any model you add in AutoJev — DeepSeek, OpenRouter, OpenAI, Ollama or another OpenAI-compatible endpoint — is available as a model entry.
Which config file does AutoJev edit?
~/.kimi-code/config.toml. If that does not exist but ~/.kimi/config.toml does, AutoJev edits the latter.
Does AutoJev have a Kimi/Moonshot preset?
No dedicated preset. Add Moonshot’s API as an OpenAI-compatible provider with its base URL and your key.
Which protocol does Kimi use with AutoJev?
The provider is written with type openai, so Kimi Code CLI sends Chat Completions. AutoJev converts for Responses or Anthropic Messages upstreams.
Will my own Kimi models be removed?
No. AutoJev only replaces model entries whose provider is autojev.
Keep exploring
Updated 2026-10-14
Give every agent the right model.
Install AutoJev, add the providers you already pay for, and connect your agents in one click. Everything stays on your machine.
Free & open source · macOS · Windows · Linux