Coding agents

Kilo Code

Connect Kilo Code in VS Code, and the Kilo CLI, to RealRelay.ai as a custom OpenAI-compatible provider: add the provider, set token limits, check the connection and switch models.

Protocol
OpenAI Chat Completions · OpenAI Responses
Base URL
https://www.realrelay.ai/v1
Official docs
kilo.ai
Checked against the tool’s docs
2026-10
Experimental. Not yet run end to end against RealRelay.ai. The steps follow the tool’s own documentation; if one fails, contact support with the error.

Overview

Kilo Code is an open source coding agent. It runs as a VS Code extension and as a terminal app, the Kilo CLI; the current extension is built on the CLI and shares its configuration. You add RealRelay.ai as a custom provider with the OpenAI Compatible API, and Kilo sends requests to the Chat Completions endpoint, /v1/chat/completions.

  • An API key from the API keys page of the console.

  • The base URL with /v1 at the end. Kilo appends /chat/completions to it.

  • A model ID exactly as GET /v1/models lists it, for example z-ai/glm-5.2. The model needs tool calling.

This guide is experimental: it follows Kilo's documentation but has not yet been run end to end against RealRelay.ai. The custom provider form has no fields for token limits, so one step below edits the config file by hand.

Install

  1. 1

    Open Extensions

    Press Ctrl+Shift+X (Cmd+Shift+X on macOS) and search for "Kilo Code".

  2. 2

    Install the current version

    Click the arrow next to Install and choose Install Pre-Release Version. Kilo ships its current extension on that Marketplace channel and recommends it for everyone.

Editors that use the Open VSX Registry, such as VSCodium, find Kilo Code under the same name in their Extensions view. You can also download the .vsix from Kilo's GitHub releases and use Install from VSIX….

npm
npm install -g @kilocode/clikilo --version

If kilo --version prints a version number, the install worked.

Configure

  1. 1

    Open the custom provider form

    In Kilo Code, open Settings (gear icon), go to the Providers tab, scroll to the bottom and click Custom provider.

  2. 2

    Fill in the fields

    When the base URL and key are valid, Kilo fetches the model list from RealRelay.ai. Pick only the models you plan to use, or type an ID by hand. Click Submit.

    Kilo Code → Settings → Providers → Custom provider
    1Provider ID:   realrelay2Display name:  RealRelay.ai3Provider API:  OpenAI Compatible4Base URL:      https://www.realrelay.ai/v15API key:       sk-***6Models:        z-ai/glm-5.2
  3. 3

    Add token limits in the config file

    Kilo saves the provider in its global config. Open ~/.config/kilo/kilo.jsonc (or kilo.json in the same folder), find provider.realrelay.models, and add the limits to each model:

    ~/.config/kilo/kilo.jsonc → provider.realrelay.models
    1"z-ai/glm-5.2": {2  "name": "z-ai/glm-5.2",3  "tool_call": true,4  "limit": {5    "context": 200000,6    "output": 320007  }8}
  1. 1

    Save your key in an environment variable

    The config reads the key from REALRELAY_API_KEY, so the file itself holds no secret.

    ~/.zshrc · ~/.bashrc
    export REALRELAY_API_KEY="sk-***"
    Windows PowerShell
    [Environment]::SetEnvironmentVariable("REALRELAY_API_KEY", "sk-***", "User")
  2. 2

    Add the provider to kilo.jsonc

    Restart the CLI after editing. A kilo.jsonc in a project folder overrides the global file.

    ~/.config/kilo/kilo.jsonc
    1{2  "$schema": "https://app.kilo.ai/config.json",3  "provider": {4    "realrelay": {5      "npm": "@ai-sdk/openai-compatible",6      "name": "RealRelay.ai",7      "env": ["REALRELAY_API_KEY"],8      "options": {9        "baseURL": "https://www.realrelay.ai/v1"10      },11      "models": {12        "z-ai/glm-5.2": {13          "name": "z-ai/glm-5.2",14          "tool_call": true,15          "limit": {16            "context": 200000,17            "output": 3200018          }19        }20      }21    }22  },23  "model": "realrelay/z-ai/glm-5.2"24}
  • Provider ID (realrelay) is your own name for the provider. Lowercase letters, numbers, hyphens and underscores only. Model references start with it, as in realrelay/z-ai/glm-5.2.

  • Provider API OpenAI Compatible is the same as "npm": "@ai-sdk/openai-compatible" in the file. Both send Chat Completions requests.

  • limit.context is the model's context window and limit.output its maximum output. Without them both resolve to 0: Kilo turns off automatic compaction and caps output at 32,000 tokens.

  • env names the variable that holds the key. In VS Code the key you type is stored separately from the config file.

Verify

  1. 1

    Call the endpoint directly

    Run this with your key. A JSON reply with a choices array means the address, key and model work.

    Terminal
    1curl -sS "https://www.realrelay.ai/v1/chat/completions" \2  -H "Authorization: Bearer sk-***" \3  -H "content-type: application/json" \4  -d '{"model": "z-ai/glm-5.2", "max_tokens": 16, "messages": [{"role": "user", "content": "Reply with OK"}]}'
  2. 2

    Check in VS Code

    RealRelay.ai should now appear among the connected providers. Choose one of its models in the model picker and send a short message. The request appears in the console's usage logs.

  3. 3

    Check in the CLI

    The first command should list your model as realrelay/…. The second sends one message and prints the reply.

    Terminal
    kilo models realrelaykilo run -m "realrelay/z-ai/glm-5.2" "Reply with OK"

Models

In VS Code, choose models in the model picker. To add or remove models, click Edit provider next to RealRelay.ai in the Providers tab. In the CLI, use /models, or start with kilo -m followed by realrelay/ and the model ID. Every model you add needs its own limit entry.

The limits in these examples are safe starting values. Set them to the real numbers from the model's catalog page.

A few OpenAI models are served on the Responses endpoint, /v1/responses. Add them as a second custom provider with the OpenAI Responses API, and keep the first provider for everything else:

Kilo Code → Settings → Providers → Custom provider
1Provider ID:   realrelay-responses2Display name:  RealRelay.ai (Responses)3Provider API:  OpenAI Responses4Base URL:      https://www.realrelay.ai/v15API key:       sk-***6Models:        openai/gpt-5.3-codex
~/.config/kilo/kilo.jsonc → provider
1"realrelay-responses": {2  "npm": "@ai-sdk/openai",3  "name": "RealRelay.ai (Responses)",4  "env": ["REALRELAY_API_KEY"],5  "options": { "baseURL": "https://www.realrelay.ai/v1" },6  "models": {7    "openai/gpt-5.3-codex": {8      "name": "openai/gpt-5.3-codex",9      "tool_call": true,10      "limit": { "context": 400000, "output": 128000 }11    }12  }13}

Which models suit an agent, and which ones the Responses endpoint serves, is under Choosing a model.

Troubleshooting

  • No models appear after entering the base URL. The URL or key is wrong, so the model fetch failed. Fix them and click Fetch models, or type the model ID by hand.

  • "Invalid API Key" or 401. Re-enter the key in the provider form. In the CLI, make sure REALRELAY_API_KEY is set in the terminal that starts kilo, and check the stored credentials:

    Terminal
    kilo auth list
  • 404. The base URL is missing /v1, or has a typo in the path. Use the address ending in /v1.

  • "Model Not Found". The model ID must match GET /v1/models exactly, including the part before the slash.

  • The conversation grows until the request is rejected. The model has no limit.context, so compaction is off. Add the limits from the Configure section.

  • Replies stop with a warning that the response may be incomplete. The model reached limit.output. Raise it, up to the model's real maximum.

  • Errors on a model under the Responses provider. Only the models listed under Choosing a model are served on /v1/responses. Move other models back to the OpenAI Compatible provider.