Kilo Code: setting up your own API in VS Code, JetBrains and the CLIAn API for AI coding agents: one key, any OpenAI-compatible tool

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:

FieldValue
Provider IDtwelver
Display nameTwelver
Provider APIOpenAI Compatible
Base URL
API key
Modelsclick Fetch models and tick the series you want
Field names from the Kilo Code docs, checked on 4 October 2026.

Provider API must be OpenAI Compatible

OpenAI Responses and Anthropic Messages are other protocols and will not work with an OpenAI-compatible endpoint. The Base URL ends in /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.

Template — this will not work as is~/.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>"
Template — this will not work as is~/.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

A repo-level 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

SeriesModelIn / out, $ per 1M
gptGPT-6 Luna0.163 / 0.813
qwen-flashQwen3.8-Flash0.244 / 0.764
zai-flashGLM-5.3-Flash0.244 / 0.813
minimaxMiniMax M3.1 Flash0.244 / 0.975
deepseek-flashDeepSeek V4.1 Flash0.488 / 1.95
auto / qwenQwen3.7-Plus0.65 / 2.6
xiaomiMiMo V2.6 Pro0.707 / 1.41
gpt-terraGPT-6.1 Terra1.63 / 8.13
deepseekDeepSeek V4 Pro2.15 / 6.44
zaiGLM-5.32.28 / 7.15
grokGrok 4.73.25 / 9.75
qwen-maxQwen3.8-Max3.25 / 9.75
gpt-solGPT-6.1 Sol3.25 / 16.25
gpt-maxGPT-6 Astra16.25 / 81.25
Rates as of 4 November 2026.

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?
Settings → Providers → Custom provider. Provider API: OpenAI Compatible; Base URL ending in /v1; your API key. Click Fetch models, tick the models and Submit.
Where is the Kilo Code config?
Global: ~/.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?
The extension is free; you pay the provider for tokens. The cheapest input of the available series is $0.163 per 1M tokens (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?
From any provider with an OpenAI-compatible API. With Twelver, a base_url and a key come from a button on the API page — no sign-up and no card; it serves 15 model series, all except Claude and Gemini. In Kilo Code it is a Custom provider with Provider API set to «OpenAI Compatible».

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
Rate your experience