Kimi Code
Kimi Code配置教程
Section titled “Kimi Code配置教程”配置文件位置
Section titled “配置文件位置”默认配置文件位于 ~/.kimi/config.toml。首次运行时,如果配置文件不存在,Kimi Code CLI 会自动创建一个默认的配置文件。
你可以通过 --config-file 参数指定其他配置文件(TOML 或 JSON 格式均可):
kimi --config-file /path/to/config.toml配置文件包含以下顶层配置项:
| 配置项 | 类型 | 说明 |
|---|---|---|
default_model | string | 默认使用的模型名称,必须是 models 中定义的模型 |
default_thinking | boolean | 默认是否开启 Thinking 模式(默认为 false) |
default_yolo | boolean | 默认是否开启 YOLO(自动审批)模式(默认为 false) |
providers | table | API 供应商配置 |
models | table | 模型配置 |
loop_control | table | Agent 循环控制参数 |
services | table | 外部服务配置(搜索、抓取) |
mcp | table | MCP 客户端配置 |
配置URL和KEY
Section titled “配置URL和KEY”**openai_legacy**
Section titled “**openai_legacy**”兼容 OpenAI Chat Completions API 接口格式。
[providers.openai]type = "openai_legacy"base_url = "https://api.4allapi.com/v1"api_key = "sk-xxx"**anthropic**
Section titled “**anthropic**”用于连接 Anthropic Claude API。
[providers.anthropic]type = "anthropic"base_url = "https://api.4allapi.com"api_key = "sk-xxx"**gemini**
Section titled “**gemini**”用于连接 Google Gemini 类模型。
[providers.gemini]type = "gemini"base_url = "https://api.4allapi.com"api_key = "sk-xxx"4All API 页脚
Section titled “4All API 页脚”4All API · 一站式AI大模型API聚合平台 | 价格 | 联系我们
© 2025 4All API. All rights reserved.