
# Kilo Code

[Kilo Code](https://kilo.ai/) is an open-source coding agent with a
VS Code extension and a terminal CLI, `kilo`. It takes custom
OpenAI-compatible providers in both.

Verified against the `kilo` CLI **7.8.1**. The config below is re-run
against that release every week, including a tool call round trip.

## Configure the CLI

Add LowRouter as a provider in `~/.config/kilo/kilo.jsonc`:

<!-- verify: kilo-config -->
```json
{
  "provider": {
    "lowrouter": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LowRouter",
      "options": {
        "baseURL": "https://api.lowrouter.ai/v1",
        "apiKey": "{env:LOWROUTER_API_KEY}"
      },
      "models": {
        "auto/mistralai/mistral-large-2512": {
          "name": "Mistral Large (LowRouter)",
          "tool_call": true,
          "limit": { "context": 256000, "output": 16384 }
        }
      }
    }
  },
  "model": "lowrouter/auto/mistralai/mistral-large-2512"
}
```

`{env:LOWROUTER_API_KEY}` is read from the environment:

```bash
export LOWROUTER_API_KEY=sk-lr-...
kilo run --auto "Summarise what this repository does"
```

`kilo` alone opens the terminal UI; `kilo run` runs one task and
exits. `--auto` approves every tool call.

Details of this config:

- `baseURL` ends in `/v1`.
- `limit` matters. Without it Kilo treats the context window as
  unknown, turns off compaction, and asks for up to 32,000 output
  tokens, which a model with a lower output cap rejects with a `400`.
  Take both numbers from the model browser.
- `tool_call: true` tells Kilo the model can use tools.
- `{env:...}` is only expanded in this global file. A `kilo.jsonc`
  inside a project does not expand it, so keep the key here.

## Configure the extension

In the extension, open **Settings → Providers**, add a custom
provider, and set:

- Provider API: **OpenAI Compatible**
- Base URL: `https://api.lowrouter.ai/v1`
- API key: your `sk-lr-...` token

The extension then loads the model list from LowRouter. It has no
headless mode, so this path is not re-run by the weekly check.

## Roo Code

Roo Code, the project Kilo Code started from, shut down in April
2026 and its repository is archived (last release 3.54.0). If you
still run it, its **OpenAI Compatible** provider takes the same Base
URL and key, plus a Model ID such as
`auto/mistralai/mistral-large-2512`. Set Context Window and Max
Output Tokens to the model's limits. Roo Code's own CLI cannot use an
OpenAI-compatible endpoint.

## Picking a model

Kilo works through function calling, so pick a model with the
*function-calling* tag. [The model browser filtered to
them](/models?function_calling=yes) lists every one.

The example uses `auto/mistralai/mistral-large-2512`, served from
the EU. `auto/qwen/qwen3-coder-30b-a3b-instruct`, a coding model
served from the EU, has been through `kilo run`'s tool loop in our
runs.

## Troubleshooting

- `404` on every request: `baseURL` is missing `/v1`.
- `400` about output tokens: the model entry has no `limit.output`,
  or it is above the model's output cap.
- `401`: `LOWROUTER_API_KEY` is not exported, or the key is in a
  project `kilo.jsonc` where `{env:...}` is not expanded.
