Kilo Gateway

Kilo Gateway 提供统一 API,通过单个端点和 API 密钥将请求路由到多种模型。它兼容 OpenAI 协议,大多数 OpenAI SDK 只需换个 base URL 就能用。

获取 API 密钥

  1. 前往 app.kilo.ai
  2. 登录或创建账户
  3. 进入 API Keys 页面,生成新密钥

CLI 配置

openclaw onboard --kilocode-api-key <key>

或设置环境变量:

export KILOCODE_API_KEY="<your-kilocode-api-key>" # pragma: allowlist secret

配置示例

{
  env: { KILOCODE_API_KEY: "<your-kilocode-api-key>" }, // pragma: allowlist secret
  agents: {
    defaults: {
      model: { primary: "kilocode/kilo/auto" },
    },
  },
}

默认模型

默认模型是 kilocode/kilo/auto,一个智能路由模型,会根据任务自动选择最合适的底层模型:

  • 规划、调试和编排类任务路由到 Claude Opus
  • 代码编写和探索类任务路由到 Claude Sonnet

可用模型

OpenClaw 在启动时会自动从 Kilo Gateway 发现可用模型。使用 /models kilocode 查看你账户可用的完整模型列表。

任何网关上可用的模型都可以通过 kilocode/ 前缀使用:

kilocode/kilo/auto              (默认 - 智能路由)
kilocode/anthropic/claude-sonnet-4
kilocode/openai/gpt-5.2
kilocode/google/gemini-3-pro-preview
...更多模型

补充说明

  • 模型引用格式为 kilocode/<model-id>(如 kilocode/anthropic/claude-sonnet-4)。
  • 默认模型:kilocode/kilo/auto
  • Base URL:https://api.kilo.ai/api/gateway/
  • 更多模型/供应商选项请参见 /concepts/model-providers
  • Kilo Gateway 底层使用 Bearer token 认证你的 API 密钥。