Use Tokun with Kilo Code
Connect Kilo Code to Tokun using your API key and a supported model.
Overview
Kilo Code, the VS Code and JetBrains agent, connects to Tokun through its OpenAI Compatible provider. Your Kilo Code workflow stays the same, and requests use Tokun's pricing and model routing.
Before you start
- A Tokun API key (starts with
sk-) from the API keys page. - A funded Tokun balance.
- Kilo Code, installed in your editor.
- A model ID, such as
anthropic/claude-opus-4-8.
Quickstart
In Kilo Code, open the provider settings and choose OpenAI Compatible, then set:
- Base URL:
https://api.tokun.sh/v1. - API Key: your Tokun
sk-… key. - Model ID: a Tokun model ID, such as
anthropic/claude-opus-4-8.
Save, then start a task.
Set up with an AI assistant
Paste this prompt into your AI coding agent. It reads the setup guide at /llms.txt and sets up Kilo Code for you. You only need to provide your API key.
Read https://tokun.sh/llms.txt and integrate Tokun into this project.You are helping the user configure Kilo Code to use Tokun. Kilo Code's provider config lives in its editor settings UI, so OUTPUT these steps for the user rather than editing anything:
1. Open Kilo Code's settings -> API Provider -> "OpenAI Compatible".
2. Base URL: https://api.tokun.sh/v1
3. API Key: the Tokun key (starts with sk-).
4. Model ID: a Tokun lab/model id, e.g. anthropic/claude-opus-4-8.
5. Save, then start a task.
The key is a Tokun sk- key (NOT an OpenAI/Anthropic key). The base URL keeps the /v1 suffix.Set up manually
All three fields (base URL https://api.tokun.sh/v1, API key, and model ID) are in Kilo Code's OpenAI Compatible provider settings. To roll back, switch back to your previous provider or clear the base URL.
Model IDs
Use any Tokun model ID in lab/model format as the Model ID, such as anthropic/claude-opus-4-8 or openai/gpt-5.5. Tokun never substitutes a different model: an unknown ID returns an error.
Official model pools
Official model pools appear in the model catalog and use a pool ID such as flash-pool. Choose an available pool from the live catalog; pool names and members are configured by Tokun administrators.
When the pool enables member selection, use pool-id/member-name, replacing the model's lab prefix with the pool ID. The selected member is the only model that can execute; the pool's pricing mode still applies. When selection is disabled, this form returns 400.
- Fixed token pricing uses the pool's input, output, cache and context-tier rates for every member, including a member you select yourself.
- Actual model pricing uses the serving member's price, frozen before the request. A retry to another member uses that member's frozen price.
- Fixed per-request pricing charges once after an upstream success response begins. Missing usage, a partial response or a client disconnect after that point still counts once. Failures before success and unsuccessful retries do not add charges.
Use a pool that lists the API format this client sends. Model pool settings in the live catalog control which members are shown and whether member selection is available.
Troubleshooting
OpenAI Compatible provider (not the Anthropic one) and keep the /v1 suffix on the base URL (https://api.tokun.sh/v1). The key is your Tokun sk- key.| Symptom | Likely cause | Fix |
|---|---|---|
401 / auth error | Wrong or missing key | Use your Tokun sk- key. |
402 / payment required | Empty Tokun balance | Top up on the Billing page. |
Model not found | Wrong or blank Model ID | Set a lab/model ID, such as anthropic/claude-opus-4-8. |