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

# Kilo Code | AI Gateway

> Route Kilo Code through the Orq.ai AI Gateway to access the full model catalog, including Claude, from a single API key.

[**Kilo Code**](https://marketplace.visualstudio.com/items?itemName=kilocode.kilo-code) is a VS Code extension for AI-assisted coding. Configure it with a Custom Provider pointing to the **AI Gateway** to access every model in the catalog, including Anthropic Claude models.

## Prerequisites

* **Kilo Code** extension installed in VS Code (`kilocode.kilo-code`)
* Active **Orq.ai** account
* [**Orq.ai** API key](/docs/ai-studio/organization/api-keys)

## Setup

Open the **Kilo Code** panel → **Settings** → **Providers** → **Custom Provider**.

Fill the fields:

| Field            | Value                                                                                               |
| ---------------- | --------------------------------------------------------------------------------------------------- |
| **Provider**     | `orq` (any string)                                                                                  |
| **Display Name** | `orqai` (any string; appears as prefix in the model selector)                                       |
| **Base URL**     | `https://api.orq.ai/v3/router`                                                                      |
| **API Key**      | `<ORQ_API_KEY>`                                                                                     |
| **Model**        | Deselect all, then activate the models to use (e.g. `anthropic/claude-sonnet-4-6`, `openai/gpt-4o`) |

Click **Submit**.

In the model selector at the bottom of the **Kilo Code** panel, pick a model (e.g. `orqai / openai/gpt-4o`).

<Warning>
  Always use the `provider/model_id` format for model IDs (e.g. `anthropic/claude-sonnet-4-6`, not `claude-sonnet-4-6`). Bare IDs return a `400 invalid model format` error.
</Warning>

## Max output tokens

**Kilo Code** defaults to 32,000 max output tokens. The Custom Provider GUI does not expose per-model token limits. For models with a smaller native cap (e.g. `openai/gpt-4o` at 16k), open `~/.config/kilo/kilo.jsonc` via **Kilo Settings → Global Config** and add a `limit` object for the model under the root `models` key:

```jsonc theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  // Merge into the existing kilo.jsonc; do not replace the whole file
  "models": {
    "openai/gpt-4o": {
      "name": "openai/gpt-4o",
      "limit": { "output": 16000, "context": 128000 }
    }
  }
}
```

Without this, **Kilo Code** sends a 32k token request. If the upstream model's native cap is lower, the request will fail with a token limit error.

## Troubleshooting

<AccordionGroup>
  <Accordion title="400 invalid model format">
    The model ID is missing the provider prefix. Change `claude-sonnet-4-6` to `anthropic/claude-sonnet-4-6`, `gpt-4o` to `openai/gpt-4o`, and so on.
  </Accordion>

  <Accordion title="Model exceeds token limit">
    Add a `limit` object for the model in `~/.config/kilo/kilo.jsonc` as shown in the Max output tokens section above. The GUI does not expose this field.
  </Accordion>

  <Accordion title="Requests not appearing in Orq.ai Traces">
    Verify the **Base URL** is set to `https://api.orq.ai/v3/router`. Requests sent to a provider's own endpoint bypass the **AI Gateway** and produce no **Traces**.
  </Accordion>
</AccordionGroup>

## Verification

Pick a model in the **Kilo Code** selector and send a message. The response appears in the panel and the request appears in [**Orq.ai** Traces](/docs/ai-studio/observability/traces) with the selected model identifier.
