---
title: "Kilo Code integration"
description: "Settings for using Kilo Code with MiniRouter."
canonical_url: "https://minirouter.sh/docs/integrations/kilo-code"
markdown_url: "https://minirouter.sh/docs/integrations/kilo-code.md"
last_updated: "2026-09-26"
---

# Kilo Code

Run Kilo Code's agent on any model in the MiniRouter catalog.

[Get a key](https://minirouter.sh/key)

[Kilo Code](https://kilo.ai) is an open-source coding agent for VS Code, JetBrains and the terminal. Add MiniRouter as a custom provider to run it on any tool-capable model in the [catalog](https://minirouter.sh/models), with one balance and per-key [spend limits](https://minirouter.sh/docs/rate-limits).

> **Note:** Kilo loads the model list from `/v1/models`, so new catalog models appear without a config change.

## Quick start

### 1. Install Kilo Code

**VS Code**

```sh
code --install-extension kilocode.Kilo-Code
```

**CLI**

```sh
npm install -g @kilocode/cli
```

### 2. Create and check a key

[Create a key](https://minirouter.sh/key), export it as `MINIROUTER_KEY`, then send one request. A JSON reply means the key and balance work.

```sh
curl https://api.minirouter.sh/v1/chat/completions \
  -H "Authorization: Bearer $MINIROUTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"zai/glm-5.3-flash","messages":[{"role":"user","content":"ping"}]}'
```

> **Tip:** Give Kilo its own key, so its spend shows separately in [Usage](https://minirouter.sh/dashboard/usage) and a limit stops only Kilo.

### 3. Add the provider

Open Kilo Code ⚙ Settings → Providers → Custom provider and fill in:

| Setting | Value |
| --- | --- |
| `Provider ID` | `minirouter` |
| `Provider API` | OpenAI Compatible |
| `Base URL` | `https://api.minirouter.sh/v1`. Never append /chat/completions. |
| `API key` | `mr-live-… (your key)` |
| `Models` | `zai/glm-5.3-flash`. Pick from the list Kilo loads from /v1/models, or type the ID. |

### 4. Send a prompt

Pick a MiniRouter model, send one prompt, then open [Activity](https://minirouter.sh/dashboard/activity). The request lists its model, tokens and exact cost.

## Pick models

Choose from the loaded list, or type any ID.

| Model ID | Uses |
| --- | --- |
| `zai/glm-5.3-flash` | Everyday coding. See [GLM 5.3 Flash](https://minirouter.sh/models/zai/glm-5.3-flash). |
| `openai/gpt-5.6-sol` | Hard plans and reviews. See [GPT 5.6 Sol](https://minirouter.sh/models/openai/gpt-5.6-sol). |
| `minirouter/auto:code` | Picks a model with reliable tool calling. See [Auto router](https://minirouter.sh/docs/auto-router). |
| `@preset/your-slug` | Your saved models and instructions. See [Presets](https://minirouter.sh/docs/presets). |

## Config files

The CLI, VS Code and JetBrains read the same files. The project file wins.

| Scope | File |
| --- | --- |
| Global | `~/.config/kilo/kilo.jsonc` |
| Project | `.kilo/kilo.jsonc` or `kilo.jsonc` in the repo root. |

> **Warning:** `{env:MINIROUTER_KEY}` resolves only in the global file. Keep the key out of project files.

Set `limit.context` and `limit.output` on each model, or Kilo never compacts. Copy both from the model's page in [Models](https://minirouter.sh/models).

## Run headless

`kilo run` runs one task without the TUI. The model is the provider ID, a slash, then the model ID.

```sh
kilo run --auto --model minirouter/zai/glm-5.3-flash "Run tests and fix failures"
```

| Flag | Does |
| --- | --- |
| `--auto` | Approves actions without asking. Without it, the run rejects them. |
| `--model` | Provider ID and model ID, for example `minirouter/minirouter/auto:code`. |

> **Warning:** `--auto` acts without confirmation. Use it only in trusted environments, with its own key and a daily [spend cap](https://minirouter.sh/docs/rate-limits).

## Recommended models

| Model | Why |
| --- | --- |
| [`zai/glm-5.3-flash`](https://minirouter.sh/models/zai/glm-5.3-flash) | Best current balance of coding ability, agentic performance, context and cost. |
| [`openai/gpt-5.6-sol`](https://minirouter.sh/models/openai/gpt-5.6-sol) | Higher-intelligence option when task quality matters more than spend. |
| [`spacexai/grok-4.6`](https://minirouter.sh/models/spacexai/grok-4.6) | Strong agentic alternative with a 500K-token window. |
| [`google/gemini-3.8-flash`](https://minirouter.sh/models/google/gemini-3.8-flash) | Multimodal coding alternative with a 1M-token window. |

Browse every model in the [catalog](https://minirouter.sh/models).

## Troubleshooting

### 404, HTML, or a parse error on every request

Almost always the base URL. Use https://api.minirouter.sh/v1 — the bare host without /v1 also works, but never append /chat/completions to the base URL field; the client adds that path itself.

Error: [400 `invalid_request`](https://minirouter.sh/docs/errors#invalid_request).

### 401 on every request

Wrong or rotated key. Keys start with mr-live-; after a rotation the old key keeps working for 24 hours, then dies.

Error: [401 `invalid_api_key`](https://minirouter.sh/docs/errors#invalid_api_key).

### 402 before any tokens arrive

Balance below the estimated cost of the request. Top up (from $0.50 with direct Solana payments) — and watch the x-minirouter-balance-usd header, the low-balance signal every response carries.

Error: [402 `insufficient_credits`](https://minirouter.sh/docs/errors#insufficient_credits).

### Response stops mid-sentence with a credits message

Balance hit $0 mid-stream. The stream ends with a terminal error naming the exact charge for tokens delivered — never a silent close.

Error: [402 `insufficient_credits`](https://minirouter.sh/docs/errors#insufficient_credits).

Every error code, with its fix: [Errors](https://minirouter.sh/docs/errors).

## Next steps

- [Presets](https://minirouter.sh/docs/presets): Save a model and its settings under one name.
- [Guardrails](https://minirouter.sh/docs/guardrails): Budgets and model lists per key.
- [Auto router](https://minirouter.sh/docs/auto-router): Let MiniRouter pick the model.
