Kilo Gateway: Unified API for Multiple Models in OpenClaw

Learn how to use Kilo Gateway's OpenAI-compatible endpoint with a single API key to access many models in OpenClaw. Covers setup, authentication, and default model routing.

Read this when

  • You want a single API key for many LLMs
  • You want to run models via Kilo Gateway in OpenClaw

Kilo Gateway funnels requests to a range of models through one OpenAI-compatible endpoint, using a single API key for authentication.

PropertyValue
Providerkilocode
AuthKILOCODE_API_KEY
APIOpenAI-compatible
Base URLhttps://api.kilo.ai/api/gateway/

Install plugin

openclaw plugins install @openclaw/kilocode-provider
openclaw gateway restart

Setup

Create an account

Head over to app.kilo.ai, log in or register, then create an API key.

Run onboarding

openclaw onboard --auth-choice kilocode-api-key

Alternatively, you can set the environment variable directly:

export KILOCODE_API_KEY="<your-kilocode-api-key>" # pragma: allowlist secret

Verify the model is available

openclaw models list --provider kilocode

Default model and catalog

By default, kilocode/kilo-auto/balanced is used, which is Kilo Gateway's balanced smart-routing tier. OpenClaw does not provide a task-to-upstream-model mapping for this tier; routing behind kilo-auto/balanced is handled entirely by Kilo Gateway.

During startup, OpenClaw queries GET https://api.kilo.ai/api/gateway/models and prepends the models it discovers to a static fallback catalog. That fallback catalog includes only kilocode/kilo-auto/balanced (Auto Balanced, input: ["text", "image"], reasoning: true, contextWindow: 1000000, maxTokens: 65536).

Every model on the gateway can be reached as kilocode/<upstream-id> (for instance kilocode/anthropic/claude-sonnet-4, kilocode/openai/gpt-5.5). To list all discovered models, run /models kilocode or openclaw models list --provider kilocode.

Config example

{
  env: { vars: { KILOCODE_API_KEY: "<your-kilocode-api-key>" } }, // pragma: allowlist secret
  agents: {
    defaults: {
      model: { primary: "kilocode/kilo-auto/balanced" },
    },
  },
}

Behavior notes

Transport and compatibility

Since Kilo Gateway is compatible with OpenRouter, it follows the proxy-style OpenAI-compatible request path instead of native OpenAI request shaping (no store, no OpenAI reasoning-effort payload).

  • Gemini-backed Kilo refs remain on the proxy-Gemini path: OpenClaw strips Gemini thought signatures there but does not activate native Gemini replay validation or bootstrap rewrites.
  • A Bearer token constructed from your API key is used for requests.

Stream wrapper and reasoning

The Kilo stream wrapper adds an X-KILOCODE-FEATURE request header (default openclaw, overridable via the KILOCODE_FEATURE env var) and standardizes reasoning-effort payloads for models that support them.

Warning

Reasoning-effort injection is skipped for kilocode/kilo-auto/balanced and x-ai/* refs. If reasoning support is required, use a concrete model ref like kilocode/anthropic/claude-sonnet-4.

Troubleshooting

  • If model discovery fails at startup, OpenClaw resorts to the static catalog, which contains kilocode/kilo-auto/balanced.
  • Verify that your API key is valid and that the models you want are enabled on your Kilo account.
  • When Gateway runs as a daemon, make sure KILOCODE_API_KEY is accessible to that process (for example in ~/.openclaw/.env or via env.shellEnv).
468 words · updated Aug 12, 2026