# Kilo Code with AnyRouter — free models, one API key

> Add AnyRouter to Kilo Code as a custom OpenAI-compatible provider and run free models with anyrouter/free.


# Kilo Code with AnyRouter

[Kilo Code](https://kilo.ai) supports custom OpenAI-compatible providers, so AnyRouter works directly.

## Set it up

1. Create a key in [Dashboard → Keys](https://anyrouter.dev/dashboard/keys) (prefix `sk-ar-`).
2. In Kilo Code open **Settings** (gear) → **Providers**, scroll down and click **Custom provider**:

   | Field | Value |
   |---|---|
   | Provider ID | `anyrouter` |
   | Display name | `AnyRouter` |
   | Provider API | `OpenAI Compatible` |
   | Base URL | `https://anyrouter.dev/api/v1` |
   | API key | your `sk-ar-` key |
   | Models | `anyrouter/free` (add `anyrouter/auto` or any catalog id) |

   Kilo Code can read the list from `/models`; if a model is missing, type its id by hand.
3. Select an AnyRouter model, run a task, and check [request logs](https://anyrouter.dev/dashboard/logs).

Kilo Code calls tools, so pick a model with tool calling ([Chat Completions models](https://anyrouter.dev/models?endpoint=chat-completions)).

## Model ids

| Model id | What it does |
|---|---|
| `anyrouter/free` | Best free model available now, with fallback. No credits. Needs Go ($2/mo, or free when you donate one working provider key); no daily cap. See [Free Tier](/features/free-tier). |
| `anyrouter/auto` | Top models (free and paid) with health-aware failover. Paid members use credits. |
| `owner/model` | A specific model, e.g. `z-ai/glm-5.2`. Ids are in the [catalog](https://anyrouter.dev/models). |

Own provider keys (BYOK) are billed by your provider: see [Use your own provider keys](/guides/byok-provider-keys) and [BYOK](/features/byok).

## Troubleshooting

| Symptom | Fix |
|---|---|
| 401 | The API key is not an active `sk-ar-` key. Check [Keys](https://anyrouter.dev/dashboard/keys). |
| 404 or model not found | The model id must match exactly, including the `owner/` prefix. |
| `400 no_eligible_models` | Privacy or routing settings (Zero Data Retention, blocked providers) excluded every candidate. Relax them or pick a specific model. |


## Related

- [Free Tier](/docs/features/free-tier.md)
- [Get a provider API key](/docs/guides/byok-provider-keys.md)
- [Bring Your Own Key (BYOK)](/docs/features/byok.md)
- [AnyRouter CLI](/docs/cli.md)
- [Cline with AnyRouter — free models, one API key](/docs/guides/cline.md)
- [Continue with AnyRouter — free models, one API key](/docs/guides/continue.md)
- [OpenCode with AnyRouter — free models, one API key](/docs/guides/opencode.md)
