Coding Tools
Kilo Code
Connect Kilo Code and Kilo CLI to TokenLab
Overview
Kilo Code supports custom OpenAI-compatible providers in its VS Code extension and Kilo CLI. Both clients share the same provider and model configuration.
Install
For VS Code, search for Kilo Code in Extensions and install the pre-release channel. Kilo documents that channel as the current stable, recommended extension.
For the CLI, run:
npm install -g @kilocode/cli@7.7.2
kilo --versionConfigure in the UI
Save the current provider, model and connection settings locally before editing. These controls change the active model selection; restore your previous values when finished. Keep signed-in accounts and tool permissions unchanged. Do not overwrite another OpenAI-compatible connection without a restorable backup.
- Open Kilo Code Settings → Providers.
- Scroll down and click Custom provider.
- Use these values:
| Field | Value |
|---|---|
| Provider ID | tokenlab |
| Display name | TokenLab |
| Provider API | OpenAI Compatible |
| Base URL | https://api.tokenlab.sh/v1 |
| API key | Your TokenLab API key |
| Model | Select or add claude-sonnet-5-5 |
Kilo automatically queries TokenLab's /v1/models endpoint after the Base URL and key are entered. Click Submit, then choose tokenlab/claude-sonnet-5-5 in the model picker.
Configure the CLI
Use the Quickstart terminal instructions for macOS, Linux, WSL, or Windows PowerShell to set TOKENLAB_API_KEY without putting the key in command history. Launch Kilo from that terminal. For persistent use, use your local secret manager; do not append a plaintext key to your shell profile.
Before starting Kilo 7.7.2, back up the active global configuration and check permission.bash. This version migrates an existing configuration without that explicit rule to bash: "allow", even when permission["*"] is deny. Preserve your current shell rule explicitly in the global file: if the existing wildcard rule is deny, merge "bash": "deny" into the existing permission object. Keep other rules intact. The separate provider file below does not prevent this client migration.
Create a separate ~/.config/kilo/tokenlab.jsonc file with the configuration below. If XDG_CONFIG_HOME is set, use kilo/tokenlab.jsonc under that directory. Keep the normal kilo.json / kilo.jsonc, accounts, default model and permissions unchanged: this separate file is loaded only for an invocation that selects it with KILO_CONFIG. If the file or provider name already belongs to another setup, choose a different file/name and adjust the commands.
{
"$schema": "https://app.kilo.ai/config.json",
"provider": {
"tokenlab": {
"options": {
"apiKey": "{env:TOKENLAB_API_KEY}",
"baseURL": "https://api.tokenlab.sh/v1"
},
"models": {
"claude-sonnet-5-5": {
"name": "Claude Sonnet 5.5",
"tool_call": true,
"reasoning": true,
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
},
"limit": {
"context": 1000000,
"output": 128000
}
}
},
"npm": "@ai-sdk/openai-compatible",
"name": "TokenLab"
}
}
}KILO_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/kilo/tokenlab.jsonc" kilo models tokenlab
KILO_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/kilo/tokenlab.jsonc" kilo --model tokenlab/claude-sonnet-5-5Saving settings or listing models does not verify a key or a completed request. A prompt uses TokenLab balance. Check the reply and its matching request record before trying tools; auxiliary requests may also be billed.
Generate images and video in the same agent
Kilo can also create images and short videos with the TokenLab MCP server. Each generation is paid from the same TokenLab balance. Merge this mcp entry into the same tokenlab.jsonc, next to provider. Kilo replaces {env:TOKENLAB_API_KEY} with the variable from your terminal, so the key is not written to the file:
{
"mcp": {
"tokenlab": {
"type": "local",
"command": ["npx", "-y", "@tokenlabai/mcp-server@0.6.48"],
"environment": {
"TOKENLAB_MCP_TOOL_PROFILE": "core",
"TOKENLAB_API_KEY": "{env:TOKENLAB_API_KEY}"
},
"timeout": 30000
}
}
}The longer timeout gives npx time to download the package on first start. Start Kilo with the same KILO_CONFIG and ask it to list its tokenlab tools. Then try:
Call get_model_pricing for nano-banana-2, then use create_image with nano-banana-2 at 1k to make a photo of a matte black coffee mug on a white desk.create_video returns a task ID. The agent calls get_task_status until the video is ready. See Kilo MCP servers for other settings.