Connect Kilo Code through an OpenAI-compatible provider
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 Grok 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 → 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 /models, preserving case, hyphens, and version suffixes; do not substitute a display name. Open its detail page and match the supported API endpoints, context window, and capabilities such as tool calling to the provider and features selected in Kilo Code. A catalog listing does not mean the client can use every feature of that model. Give each tool a dedicated API key with a maxSpend cap.
Which API protocol is Kilo Code using?
OpenAI-compatible describes an interface format; it does not make Chat Completions (/v1/chat/completions), Responses (/v1/responses), and Anthropic Messages (/v1/messages) interchangeable. Check the installed client version, provider configuration, and actual request path against the model detail page and API compatibility fact sheet. A successful plain-text chat does not establish support for hosted tools, conversation state, or file-editing features.
Verify the Kilo Code call in your request trace
Send a simple text request from Kilo Code, then match its trace in Dashboard → Logs by time, model, and request_id: tokens, cost, latency, and status. Next, test streaming, tool calls, and multi-turn history separately. For failures, retain the actual request path, full error message, and request_id. If there is no matching log, check client configuration and connectivity before attributing the error to the gateway or upstream.
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?
Choose a current catalog model that supports both the endpoint and the features Kilo Code uses. Check /models and the model detail page for the exact ID, current rates, and capabilities; a family name such as GPT or Claude is not a compatibility guarantee. Seeing a model in the picker confirms discovery, so verify an actual request too.
Models are listed, but requests fail with 400 or 404. What should I check?
Record the actual request path and error message, then check the exact model ID. A 400 can indicate invalid parameters, unsupported tools, or a model/endpoint mismatch; a 404 can indicate an incorrect path or missing resource, so it does not by itself establish that a model was retired. If the error says must be called via, use the named endpoint or select a model supported on the current endpoint. Do not add or remove /v1 or /chat/completions across all clients indiscriminately.
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/402/403/429?
Match the request and error message in Dashboard → Logs. For 401, check whether the key was sent and is valid; for 402, check wallet balance and maxSpend; for 403, check key permissions and access restrictions. For 429, distinguish request/token limits from upstream throttling using the error details. Keep the request_id and follow the error-codes reference.