relay.fast
Kilo Code setup

Connect Kilo Code to relay.fast

Kilo Code is an open-source coding agent for VS Code and the terminal. Current releases use the OpenCode provider format, so relay.fast is added as an OpenAI-compatible provider in a config file while the key stays in an environment variable.

Start with relay.fast Read the API docs Русская версия

Configuration file

Save this file, for example as ~/.config/kilo/relayfast.json, and list the models you want under models.

{
  "$schema": "https://app.kilo.ai/config.json",
  "provider": {
    "relayfast": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "relay.fast",
      "options": {
        "baseURL": "https://relay.fast/v1",
        "apiKey": "{env:RELAY_FAST_KILO_API_KEY}"
      },
      "models": {
        "claude-sonnet-5-5": { "name": "claude-sonnet-5-5" },
        "glm-5.3": { "name": "glm-5.3" }
      }
    }
  },
  "model": "relayfast/claude-sonnet-5-5"
}

Then point KILO_CONFIG at the file and put the key in the variable the file references:

# macOS and Linux
export KILO_CONFIG=~/.config/kilo/relayfast.json
export RELAY_FAST_KILO_API_KEY=sk-your-api-key

# Windows (PowerShell), then open a new terminal
setx KILO_CONFIG "$HOME\.config\kilo\relayfast.json"
setx RELAY_FAST_KILO_API_KEY sk-your-api-key

Close Kilo Code completely, in every VS Code window and terminal, and start it again so it reads the new variables.

One-command setup

The script configures Kilo Code for relay.fast. It writes the file with every chat model your key can use, keeps the key in the RELAY_FAST_KILO_API_KEY variable, and adds the provider to an existing KILO_CONFIG file instead of replacing it. It asks for the API key inside the script, so the key never appears in the command or shell history. Every downloaded file is checked against a published SHA-256 checksum, and running it again can restore the previous settings.

Windows (PowerShell):

powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://relay.fast/downloads/setup/install-kilo-code-en.ps1 | iex"

macOS and Linux:

curl -fsSL https://relay.fast/downloads/setup/install-kilo-code-en.sh | bash

You can read the script before running it by opening the same URL in a browser.

If your version has provider settings in the UI

Some Kilo Code releases configure providers on a settings screen. Choose OpenAI Compatible there and enter the same base URL https://relay.fast/v1, the key and a model ID.

Keep agent costs under control

A coding agent sends the conversation, file contents and tool results with every step, so input tokens make up most of the bill. Use a mid-priced model for routine edits and a frontier model for hard tasks, prefer models with a cache-read price for long sessions, and keep auto-approve limits low until you know what a typical task costs. Current prices are in the live pricing catalog.

Current prices of models for coding agents

Prices checked from the live catalog. "From" is the lowest price among the relay.fast sources that currently serve the model. The price you pay depends on the source your request uses and can change on any day. The pricing page always shows current values.

ModelModel IDOfficial input / output per 1M tokensrelay.fast from, input / outputCache read fromContext
Claude Sonnet 5.5claude-sonnet-5-5$2 / $10$0.238 / $1.19 (−88%)$0.02381M
Claude Opus 5.5claude-opus-5-5$4 / $20$0.111 / $0.556 (−97%)$0.005561M
GPT-6.1 Sol
requests above 272K input tokens cost more
gpt-6.1-sol$2 / $10$0.03 / $0.15 (−98%)$0.00151.05M
GLM-5.3glm-5.3$1.4 / $4.4$0.035 / $0.11 (−97%)$0.00651M
Kimi K3kimi-k3$3 / $15$0.15 / $0.75 (−95%)$0.0151.05M
DeepSeek V4.1 Flash
price depends on the time of day; the peak-hours price is shown
deepseek-v4.1-flash$0.3 / $1.2$0.03 / $0.12 (−90%)$0.00061M

Frequently asked questions

Why is the key in an environment variable?

The config file refers to {env:RELAY_FAST_KILO_API_KEY}, so the file can be shared or backed up without the key.

Can I use Gemini models in Kilo Code?

Yes. The installer adds them through a separate Gemini-format provider that uses the same key.

How do I undo the setup?

Run the installer again and choose restore, or remove the provider from the file and unset KILO_CONFIG.