> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://www.respan.ai/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://www.respan.ai/docs/_mcp/server.

# Kilo Code (gateway)

> Set up Kilo Code with the Respan gateway.

Route [Kilo Code](https://kilo.ai)'s LLM calls through the Respan gateway for automatic logging, caching, and model switching. Kilo Code ships an OpenAI Compatible provider in both the editor extension and the CLI, so only your `RESPAN_API_KEY` is needed.

## Setup

#### Install Kilo Code

Install the **Kilo Code** extension from the VS Code Marketplace (or your editor's extension panel), then open it from the sidebar. For the terminal, install the CLI:

```bash
npm install -g @kilocode/cli
```

#### Add Respan as a custom provider

In the extension:

1. Click the gear icon to open Kilo Code **Settings** and go to the **Providers** tab.
2. Scroll to the bottom and click **Custom provider**.
3. Fill in the dialog:
   * **Provider ID**: `respan`
   * **Display name**: `Respan Gateway`
   * **Provider API**: `OpenAI Compatible`
   * **Base URL**: `https://api.respan.ai/api`
   * **API key**: `YOUR_RESPAN_API_KEY`
   * **Models**: add `gpt-4o` and any other model IDs you want
4. Click **Submit** to save.

Add model IDs by hand. Kilo Code's automatic model detection queries `/v1/models`, which the gateway does not expose yet.

In the CLI, add the provider to `~/.config/kilo/kilo.json`:

```json
{
  "$schema": "https://kilo.ai/config.json",
  "provider": {
    "respan": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Respan Gateway",
      "options": {
        "baseURL": "https://api.respan.ai/api",
        "apiKey": "{env:RESPAN_API_KEY}"
      },
      "models": {
        "gpt-4o": { "name": "GPT-4o" },
        "claude-sonnet-4-5-20250929": { "name": "Claude Sonnet 4.5" }
      }
    }
  },
  "model": "respan/gpt-4o"
}
```

Then export the key:

```bash
export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
```

No separate provider key needed. The Respan gateway handles provider authentication.

#### Start coding

Select your Respan provider and model in the chat panel, or run a task from the terminal:

```bash
kilo run -m respan/gpt-4o "your prompt"
```

All LLM calls now route through Respan.

## Switch models

Add more model IDs to the provider and pick a different one from the model dropdown (or `-m respan/<id>` in the CLI) to use any of the 1000+ models available through the gateway.

```text
gpt-4o
claude-sonnet-4-5-20250929
gemini/gemini-3.5-flash
```

See the [full model list](https://platform.respan.ai/platform/models).