Skip to main content
Route every model call Kimi Code makes through the Orq.ai AI Gateway by editing a single configuration file. Requests appear in Traces automatically.

Prerequisites

curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

Setup

Kimi Code is OpenAI-compatible. Edit ~/.kimi-code/config.toml to add an Orq.ai provider pointed at the router, and register each model as its own [models."..."] block:
default_model = "orq/claude-sonnet-4-6"

[providers.orq]
type = "openai"
api_key = "<ORQ_API_KEY>"
base_url = "https://api.orq.ai/v3/router"

[models."orq/claude-sonnet-4-6"]
provider = "orq"
model = "anthropic/claude-sonnet-4-6"
max_context_size = 200000
max_output_size = 64000
capabilities = ["thinking", "tool_use"]
display_name = "Claude Sonnet 4.6"

[models."orq/gpt-4o"]
provider = "orq"
model = "openai/gpt-4o"
max_context_size = 128000
max_output_size = 16384
capabilities = ["tool_use"]
display_name = "GPT-4o"
Replace <ORQ_API_KEY> with an API key. If ~/.kimi-code/config.toml does not exist yet, create it. Each model value is an identifier from the AI Gateway catalog, so add a [models."..."] block for every model you want. default_model sets the one loaded at startup; switch between registered models at any time with /model inside Kimi Code. Launch Kimi Code:
kimi
To configure the provider through the interactive manager instead of editing the file, run /provider inside Kimi Code.

Verification

Once configured, send a prompt in Kimi Code. The response appears in the terminal and the trace appears in Orq.ai Traces with the model identifier you selected.

Connect via MCP

Kimi Code also acts as an MCP client, so the Orq MCP server can run alongside the gateway routing above. With both connected, Kimi Code routes model calls through the AI Gateway and manages Agents, experiments, Datasets, and Traces through the Orq MCP tools. Add the Orq MCP server to ~/.kimi-code/mcp.json (or the project-local .kimi-code/mcp.json):
{
  "mcpServers": {
    "orq": {
      "url": "https://my.orq.ai/v2/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_ORQ_API_KEY"
      }
    }
  }
}
Replace YOUR_ORQ_API_KEY with an API key. Manage servers from the terminal with the kimi mcp command group. See the MCP Quickstart for the full tool reference.
Orq.ai API keys are scoped to a single project, so the Orq MCP server only exposes the Agents, experiments, Datasets, and Traces within that project. Use a key from the project whose entities Kimi Code should manage.