Coding tools
Kilo Code setup: add a custom OpenAI-compatible provider
In short: Kilo Code is a VS Code and CLI coding agent that supports our gateway as a custom OpenAI Compatible provider, set up in the extension or in kilo.jsonc.
On this page
https://api.oneaiapikey.com/v1Kilo Code is an open-source coding agent available as a VS Code extension and a CLI. It has first-class support for custom providers, including any endpoint that speaks the OpenAI Chat Completions format. Add our gateway once and every model in the catalogue becomes available in Kilo, billed from one prepaid balance.
What do I need to use Kilo Code with the gateway?
Using Kilo Code with the gateway needs three things:
- Kilo Code installed (the VS Code extension, the CLI, or both).
- A funded account: any balance above $0, the sign-up credit included, pays for every model; when it runs out, add $1 or more (create an account).
- An API key from the console (it starts with
sk-).
How do I set up Kilo Code in the VS Code extension?
Add the gateway as a custom provider in Kilo Code’s settings:
- Open Kilo Code’s Settings (gear icon) and go to the Providers tab.
- Scroll to the bottom and click Custom provider.
- Fill in the dialog:
Provider ID: one-ai-api-key
Display name: One AI API Key
Provider API: OpenAI Compatible
Base URL: https://api.oneaiapikey.com/v1
API key: sk-your-key-here
Models: pick from the fetched list, or add ids manually- Click Submit to save.
A few details matter here:
- Provider API must be OpenAI Compatible. Kilo also offers “OpenAI Responses” and “Anthropic Messages” options; stick with OpenAI Compatible for this setup, since it works for every model we serve, Claude included.
- Base URL is the
/v1root, not a full endpoint such as/v1/chat/completions. - Once the URL and key are valid, Kilo fetches the model list from our
/v1/modelsendpoint automatically. If the list stays empty, fix the key or URL and click Fetch models again.
How do I set up Kilo Code for the CLI?
The CLI (and any extra model tuning) uses a kilo.jsonc config file. Put the provider in your global config at ~/.config/kilo/kilo.jsonc:
{
"$schema": "https://app.kilo.ai/config.json",
"model": "one-ai-api-key/claude-sonnet-5-5",
"provider": {
"one-ai-api-key": {
"npm": "@ai-sdk/openai-compatible",
"name": "One AI API Key",
"options": {
"baseURL": "https://api.oneaiapikey.com/v1",
"apiKey": "{env:ONEAIAPIKEY_API_KEY}"
},
"models": {
"claude-sonnet-5-5": { "name": "Claude Sonnet 5.5", "tool_call": true },
"gpt-6.1-sol": { "name": "GPT-6.1 Sol", "tool_call": true },
"glm-5.3-flash": { "name": "GLM-5.3 Flash", "tool_call": true }
}
}
}
}Then store the key in the environment variable the config refers to:
export ONEAIAPIKEY_API_KEY="sk-your-key-here"setx ONEAIAPIKEY_API_KEY "sk-your-key-here"The model key uses the provider-id/model-id format. Keep the {env:...} reference in the global file: Kilo doesn’t resolve environment references in a project-level kilo.jsonc, and you should never commit a raw key to a repository anyway.
Which models work best with Kilo Code?
These are the recommended models for Kilo Code. Prices are USD per 1M tokens and come straight from our catalogue:
| Model id | Good for | Input | Output |
|---|---|---|---|
claude-sonnet-5-5 | Daily coding, Coding agents, Code review | $1.40 | $7 |
claude-opus-5-5 | Agentic coding, Large refactors, Complex reasoning | $2.80 | $14 |
gpt-6.1-sol | Codex CLI, Tool calling, Long context | $0.70 | $3.50 |
grok-4.7 | Research, Tool calling, Long context | $1.40 | $4.20 |
glm-5.3-flash | Quick answers, Drafting, Sub-agents | $0.07 | $0.21 |
Kilo’s agents lean on tool calls, so mark models with "tool_call": true in the config file. claude-sonnet-5-5 is a dependable default; glm-5.3-flash is the budget pick for sub-tasks. The full list lives on the models page.
How do I verify Kilo Code works?
Verify the setup in VS Code by selecting one of the gateway’s models in the Kilo model picker and asking a simple question about your project. On the CLI, start Kilo and send a short prompt. A normal reply, plus a matching entry in your console’s usage log, confirms the setup.
To test the key on its own:
curl -sS https://api.oneaiapikey.com/v1/models -H "Authorization: Bearer sk-your-key-here"How do I fix common Kilo Code errors?
The common Kilo Code errors and their fixes are listed below.
401 Unauthorized. The key is wrong, disabled, or (in the CLI) the environment variable isn’t set in the terminal that launched Kilo. Re-copy the key and open a fresh terminal after setx.
No models appear in the picker. Auto-fetch failed, which nearly always means a bad key or base URL. Fix it and click Fetch models, or add the ids manually.
404 Not Found. Check the base URL is exactly https://api.oneaiapikey.com/v1, with no trailing slash.
“Model not found” or “no available channel”. The model id doesn’t match the catalogue. In the config file the key under models must be the exact id, such as claude-sonnet-5-5.
Request timed out. Kilo streams responses, so long generations normally stay alive. For your own scripts, use "stream": true on long outputs, because proxies cut idle non-streaming requests at roughly 100 seconds.
Wrong provider API selected. If you picked “OpenAI Responses” or “Anthropic Messages” by mistake, requests go to the wrong path. Edit the provider and switch it to OpenAI Compatible.
Next steps
See the Cline and OpenCode guides for similar tools, or browse every tool guide. Current per-model rates are on the pricing page.