Skip to main content
Kimi Code CLI (kimi) is Moonshot AI’s terminal coding agent. It reads custom providers and models from ~/.kimi-code/config.toml and supports OpenAI-compatible Chat Completions (openai), OpenAI Responses (openai_responses), and Anthropic Messages (anthropic). Kimi Code sends tool definitions with every request, so choose a model that supports function calling.

Overview

Pointing Kimi Code at Eden AI gives you:
  • 500+ models: switch between Kimi, Claude, GPT, Gemini, and more from one config file
  • One API key: unified billing, routing, and monitoring across providers
  • Expert models as MCP tools: connect Eden AI’s MCP server for OCR, web search, speech, and translation

Prerequisites

Setup

1. Configure ~/.kimi-code/config.toml

Kimi Code reads its provider and model definitions from ~/.kimi-code/config.toml (creating the file on first run if it does not exist). Add an edenai provider using type = "openai" (the OpenAI Chat Completions protocol) and declare the models you want to use:
~/.kimi-code/config.toml
TOML requires quotes around section keys that contain dots, such as [models."kimi-k2.7-code"]. default_model must match one of the keys defined under [models.*].

2. Launch Kimi Code

To use a separate configuration for a specific project or environment, create a directory and copy the configuration above to config.toml in it. Then point KIMI_CODE_HOME at that directory:

Model naming and switching

Set model to any canonical model name (such as kimi-k2.7-code, kimi-k3.1-pro, claude-sonnet-5.5, or gpt-5.5) or a specific provider/model ID from GET https://api.edenai.run/v3/models?view=models (see List Models). Use the model’s context_length from the catalog for max_context_size. Because Kimi Code attaches tool definitions on every turn, only pick models whose catalog entry has capabilities.supports_function_calling: true. To switch models for a single session, pass --model:

Other provider protocols

openai (Chat Completions) is the simplest default because every chat model in the Eden AI catalog supports it. If you prefer another wire protocol under https://api.edenai.run/v3:
  • type = "openai_responses" sends requests to /v3/responses.
  • type = "anthropic" sends requests to /v3/v1/messages (use this for Claude models).

Expert Models as Tools (MCP)

Eden AI hosts an MCP server that exposes OCR, web search, speech, translation, and more as tools. Run /mcp-config inside a Kimi Code session to add it, or edit ~/.kimi-code/mcp.json directly ($KIMI_CODE_HOME/mcp.json when KIMI_CODE_HOME is set, or .kimi-code/mcp.json for a single project):
~/.kimi-code/mcp.json
The MCP example reads the same EDENAI_API_KEY variable exported above, so no key is stored in the file. Export it in each shell that launches Kimi Code. After editing the file directly, start a new Kimi Code session. Run /mcp to check the connected server and its loaded tools. See the MCP server page for the full tool catalog.

Troubleshooting

Authentication errors

Verify that EDENAI_API_KEY is exported in the shell launching Kimi Code and that the key has LLM access enabled. You can test the same /v3/chat/completions endpoint directly:

Connection issues

Confirm base_url is https://api.edenai.run/v3 without a trailing /chat/completions. With type = "openai", Kimi Code appends /chat/completions automatically. Check Eden AI’s service status at app-edenai.instatus.com.

Missing max_context_size or model errors

Kimi Code requires max_context_size on every [models.*] entry. Confirm the model ID exists in GET https://api.edenai.run/v3/models?view=models and that its capabilities.supports_function_calling field is true.

Next Steps

  • Claude Code: Anthropic’s official CLI on Eden AI
  • Codex CLI: OpenAI’s local coding agent on Eden AI
  • OpenCode: terminal coding agent with auto-generated config
  • List Models: browse the catalog with capabilities and pricing
  • MCP server: the full expert model tool catalog