# Connect Kilo Code to every model through one endpoint

> Markdown mirror of https://router.one/integrations/kilo-code for AI assistants and crawlers. Router One is an OpenAI-compatible LLM API gateway.
> Last updated: 2026-09-02

Kilo Code is the open-source VS Code coding agent that grew out of the Roo Code and Cline lineage, and like them it bills through whatever API provider you plug in. Registering Router One as its OpenAI Compatible provider puts GPT, Claude, Gemini, and DeepSeek family models in its model picker behind one key — and since its agents burn tokens fast, the per-request cost trace shows exactly where each task's spend went, with a maxSpend cap on the key as the hard stop.

## Configure Kilo Code to use the Router One base URL

Open Kilo Code's settings (gear icon) → Providers, click Custom provider at the bottom of the list, set Provider API to OpenAI Compatible, and fill in the base URL and your key. With both in place Kilo Code queries the gateway's /models endpoint and lets you pick from the catalog; if that fetch fails, enter the exact model ID from /models by hand. Older builds expose the same three fields directly under API Provider → OpenAI Compatible as Base URL, API Key, and Model ID:

`kilo-code-settings`

```bash
# Kilo Code → Settings → Providers → Custom provider
Provider ID:    router-one
Display name:   Router One
Provider API:   OpenAI Compatible
Base URL:       https://api.router.one/v1
API key:        sk-your-router-one-key
Models:         <pick from the fetched list, or add the exact ID from /models>
# Older builds: API Provider → OpenAI Compatible → Base URL / API Key / Model ID
```

## Which model ID should Kilo Code send?

Copy the exact model ID from the /models page — IDs are case-sensitive, and the page lists each model's context window, capabilities, and current per-token rates. Create a dedicated API key per tool with its own maxSpend cap, so one runaway tool can't affect other workloads.

## Verify the Kilo Code call in your request trace

After your first request, open Dashboard → Logs to see its full trace: model, tokens, cost, latency, and status code. From here every Kilo Code call has a ledger and a trail instead of being a black box.

## FAQ

### Can each Kilo Code mode use a different model?

Yes. Kilo Code keeps a default model per agent — Code, Architect, Debug and the others — under Settings → Models, and remembers the last model you picked for each one; older builds pin an API configuration profile to each mode from the Prompts tab instead. Every model still runs on the same Router One key, so a cheaper model for routine edits and a stronger one for planning show up side by side in one cost trace.

### Does the base URL need /v1?

Use https://api.router.one/v1 — the standard form Kilo Code documents. Kilo Code also accepts a full endpoint URL ending in /chat/completions for gateways with unusual paths, but Router One follows the standard layout, so the /v1 base is all it needs.

### Which models can Kilo Code use through the gateway?

Any chat-capable model in the catalog — GPT, Claude, Gemini, Grok, DeepSeek, GLM, MiniMax, and Doubao families. The /models page is the source of truth for model IDs and per-token rates.

### Does this work from Mainland China?

Yes. The gateway is reachable from Mainland China without a VPN, and the configuration is identical to the global setup.

### How do I debug a 401/403/429?

Open Dashboard → Logs first to see whether requests reached the gateway and with what status, then walk the error-codes reference to check env vars, key status, and limits.

## See also

- All integration guides: https://router.one/integrations
- Debug 401/403/429 in Kilo Code: https://router.one/llm-api-error-codes
- Cursor setup: https://router.one/integrations/cursor
- OpenClaw setup: https://router.one/integrations/openclaw
- Roo Code setup: https://router.one/integrations/roo-code
- Cline setup: https://router.one/integrations/cline
- One gateway behind every coding tool: https://router.one/use-cases/ai-coding-tools
- What the gateway layer does: https://router.one/llm-api-gateway
- OpenAI-compatible API: https://router.one/openai-compatible-api
- API docs: https://router.one/docs
- Canonical page: https://router.one/integrations/kilo-code
- Models and per-model token rates: https://router.one/models (markdown: https://router.one/models.md)
- Pricing: https://router.one/pricing
- API docs (markdown): https://router.one/docs.md
- Company facts: https://router.one/facts/company.md
