TokenLab

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 --version

Configure 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.

  1. Open Kilo Code Settings → Providers.
  2. Scroll down and click Custom provider.
  3. Use these values:
FieldValue
Provider IDtokenlab
Display nameTokenLab
Provider APIOpenAI Compatible
Base URLhttps://api.tokenlab.sh/v1
API keyYour TokenLab API key
ModelSelect or add kimi-k3

Kilo automatically queries TokenLab's /v1/models endpoint after the Base URL and key are entered. Click Submit, then choose tokenlab/kimi-k3 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": {
        "kimi-k3": {
          "name": "Kimi K3",
          "tool_call": true,
          "reasoning": true,
          "modalities": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 1048576,
            "output": 131072
          }
        }
      },
      "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/kimi-k3

Saving 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.

Troubleshooting

On this page