Kimi Code
Kimi Code Configuration Guide
Section titled “Kimi Code Configuration Guide”Configuration File Location
Section titled “Configuration File Location”The default configuration file is located at ~/.kimi/config.toml. On first run, if the configuration file does not exist, the Kimi Code CLI will automatically create a default one.
You can specify a different configuration file using the --config-file argument (both TOML and JSON formats are supported):
kimi --config-file /path/to/config.tomlConfiguration Items
Section titled “Configuration Items”The configuration file contains the following top-level settings:
| Configuration Item | Type | Description |
|---|---|---|
default_model | string | The default model to use; must be a model defined in models |
default_thinking | boolean | Whether to enable Thinking mode by default (defaults to false) |
default_yolo | boolean | Whether to enable YOLO (auto-approval) mode by default (defaults to false) |
providers | table | API provider configuration |
models | table | Model configuration |
loop_control | table | Agent loop control parameters |
services | table | External service configuration (search, crawling) |
mcp | table | MCP client configuration |
Configuring URLs and Keys
Section titled “Configuring URLs and Keys”**openai_legacy**
Section titled “**openai_legacy**”Compatible with the OpenAI Chat Completions API format.
[providers.openai]type = "openai_legacy"base_url = "https://api.4allapi.com/v1"api_key = "sk-xxx"**anthropic**
Section titled “**anthropic**”Used to connect to the Anthropic Claude API.
[providers.anthropic]type = "anthropic"base_url = "https://api.4allapi.com"api_key = "sk-xxx"**gemini**
Section titled “**gemini**”Used to connect to Google Gemini-style models.
[providers.gemini]type = "gemini"base_url = "https://api.4allapi.com"api_key = "sk-xxx"4All API Footer
Section titled “4All API Footer”4All API · One-stop AI large model API aggregation platform | Pricing | Contact Us
© 2025 4All API. All rights reserved.