Kilo Code: setting up your own API in VS Code, JetBrains and the CLI
In short: open Kilo Code settings (the gear) → Providers → Custom provider, pick OpenAI Compatible, paste the Base URL and key — Kilo fetches the model list itself. Every field, the same provider in kilo.jsonc for the CLI and JetBrains, and the usual errors.
What Kilo Code is
Kilo Code is an open-source coding agent. It runs as a VS Code extension, a JetBrains plugin and a CLI — and all three read the same settings file. Besides Kilo's built-in gateway you can plug in any OpenAI-compatible API.
Step 1. Get a Base URL and key
The button below creates a Base URL like https://twelver.app/api/ai/<config-id>/v1 and a key like sk-…. The key is shown once — copy it right away.
Right on this page
Get a Base URL and key for Kilo Code
The block shows exactly the values to paste into Kilo Code — yours, not placeholders. You can send a first request here too.
Press it and get your base_url and API key.
No sign-up, no card.
Free. Your key appears right here.
Step 2. Add the provider in VS Code
Gear → Providers → scroll down → Custom provider:
| Field | Value |
|---|---|
| Provider ID | twelver |
| Display name | Twelver |
| Provider API | OpenAI Compatible |
| Base URL | |
| API key | |
| Models | click Fetch models and tick the series you want |
Provider API must be OpenAI Compatible
/v1, with no trailing slash.If the fields don't match
Ask the AI to set up Kilo Code for you
A chat opens with the question already typed. The API integrator hands you your base_url and key, dictates every Custom provider field, builds kilo.jsonc and works out the cost.
The same in kilo.jsonc
Global settings live in ~/.config/kilo/kilo.jsonc (Windows: C:\Users\<name>\.config\kilo\kilo.jsonc); per project — kilo.jsonc or .kilo/kilo.jsonc.
~/.zshrc or ~/.bashrcThe highlighted parts are stand-ins. The button above issues them in seconds, no sign-up.export TWELVER_API_KEY="sk-<your-key>"~/.config/kilo/kilo.jsoncThe highlighted parts are stand-ins. The button above issues them in seconds, no sign-up. The blue part is not a stand-in: {env:…} reads an environment variable — leave it exactly as written.{
"provider": {
"twelver": {
"npm": "@ai-sdk/openai-compatible",
"name": "Twelver",
"options": {
"baseURL": "https://twelver.ru/api/ai/<your-config-id>/v1",
"apiKey": "{env:TWELVER_API_KEY}"
},
"models": {
"auto": { "name": "Qwen3.7-Plus" },
"qwen-flash": { "name": "Qwen3.8-Flash" },
"zai": { "name": "GLM-5.3" },
"grok": { "name": "Grok 4.7" }
}
}
},
"model": "twelver/auto",
"small_model": "twelver/qwen-flash"
}{env:…} only resolves in the global file
kilo.jsonc cannot expand {env:TWELVER_API_KEY}, so keep the provider in the global file. Kilo no longer reads ~/.config/opencode.Which series to pick
| Series | Model | In / out, $ per 1M |
|---|---|---|
| gpt | GPT-6 Luna | 0.163 / 0.813 |
| qwen-flash | Qwen3.8-Flash | 0.244 / 0.764 |
| zai-flash | GLM-5.3-Flash | 0.244 / 0.813 |
| minimax | MiniMax M3.1 Flash | 0.244 / 0.975 |
| deepseek-flash | DeepSeek V4.1 Flash | 0.488 / 1.95 |
| auto / qwen | Qwen3.7-Plus | 0.65 / 2.6 |
| xiaomi | MiMo V2.6 Pro | 0.707 / 1.41 |
| gpt-terra | GPT-6.1 Terra | 1.63 / 8.13 |
| deepseek | DeepSeek V4 Pro | 2.15 / 6.44 |
| zai | GLM-5.3 | 2.28 / 7.15 |
| grok | Grok 4.7 | 3.25 / 9.75 |
| qwen-max | Qwen3.8-Max | 3.25 / 9.75 |
| gpt-sol | GPT-6.1 Sol | 3.25 / 16.25 |
| gpt-max | GPT-6 Astra | 16.25 / 81.25 |
The same idea in other agents — Cline setup and opencode. The whole book — an API for AI agents.
Frequently asked questions
How do I connect my own API to Kilo Code?
/v1; your API key. Click Fetch models, tick the models and Submit.Where is the Kilo Code config?
~/.config/kilo/kilo.jsonc. Project: kilo.jsonc or .kilo/kilo.jsonc. The VS Code extension, the JetBrains plugin and the CLI all read it.Is Kilo Code free?
qwen-flash); a sensible main model is auto at 0.65 / 2.6 per 1M in / out.Where do I get an API key for Kilo Code?
Try it yourself
Everything in this guide runs inside Twelver
One chat for text, images, video, music and voice — no separate services or subscriptions.
Open Twelver chat