> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Kimi Code

> Route Kimi Code model calls through Orq.ai AI Gateway for unified observability, cost tracking, and model governance, and use Orq MCP skills

Route every model call Kimi Code makes through the [**Orq.ai AI Gateway**](/docs/ai-studio/ai-gateway/quickstart) by editing a single configuration file. Requests appear in [Traces](/docs/ai-studio/observability/traces) automatically.

## Prerequisites

* [Kimi Code](https://code.kimi.com) installed:

<CodeGroup>
  ```bash macOS / Linux theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
  ```

  ```bash Homebrew theme={"theme":{"light":"github-light","dark":"github-dark"}}
  brew install kimi-code
  ```

  ```powershell Windows theme={"theme":{"light":"github-light","dark":"github-dark"}}
  irm https://code.kimi.com/kimi-code/install.ps1 | iex
  ```
</CodeGroup>

* Active **Orq.ai** account with **AI Gateway** access
* [Orq.ai API key](/docs/ai-studio/organization/api-keys)

## 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:

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
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](/docs/ai-studio/organization/api-keys). 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:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
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](/docs/ai-studio/observability/traces) with the model identifier you selected.

## Connect via MCP

Kimi Code also acts as an MCP client, so the [**Orq MCP**](/docs/ai-studio/integrations/code-assistants/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`):

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "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](/docs/ai-studio/organization/api-keys). Manage servers from the terminal with the `kimi mcp` command group. See the [MCP Quickstart](/docs/ai-studio/integrations/code-assistants/orq-mcp) for the full tool reference.

<Note>
  **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.
</Note>
