> ## Documentation Index
> Fetch the complete documentation index at: https://evolink.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Kilo Code VS Code

> Connect the Kilo Code VS Code extension to EvoLink.AI

## Overview

Kilo Code is an open-source AI coding assistant available in VS Code and the terminal. This version of the tutorial focuses on the **VS Code extension**, which embeds the Kilo runtime and does not require a separate CLI installation.

By setting Kilo Code's provider to **OpenAI Compatible** and pointing it at EvoLink, you can use EvoLink's Claude family of models directly inside VS Code, enabling multi-model access through a single unified key.

<Card title="Prefer the terminal?" icon="terminal" href="/docs/en/integration-guide/kilo-code-cli">
  Follow the dedicated Kilo Code CLI tutorial instead.
</Card>

## Before You Begin

### 1. Install the Kilo Code Extension

Search for **Kilo Code** in the VS Code Extension Marketplace and install it. After installation, the Kilo Code icon appears in the sidebar.

### 2. Get an EvoLink API Key

* Log in to the [EvoLink console](https://evolink.ai/dashboard)
* Find API Keys in the console, click the "Create New Key" button, then copy the generated key
* The API Key usually starts with `sk-`. Please keep it safe.

## Step 1: Configure the OpenAI Compatible Provider

Open Kilo Code's Settings, select **OpenAI Compatible** under **API Provider**, then fill in:

* **Base URL**: `https://direct.evolink.ai/v1`
* **API Key**: enter your EvoLink API Key (**the raw key — do not include the `Bearer ` prefix**)

<Warning>
  **Enter the raw key as your API Key — do not include the `Bearer ` prefix.** Kilo Code automatically adds the `Bearer` authentication header for you. If you manually enter `Bearer sk-xxx`, the gateway receives a double Bearer and returns `401 unauthorized Invalid API key` directly.

  This is the exact opposite of pi (where pi requires you to enable Bearer manually). When configuring Kilo Code, follow this page rather than copying pi's approach.
</Warning>

<Note>
  Entering the Base URL up to the `/v1` root is sufficient. Kilo Code automatically appends the remaining path, so there's no need to add `/chat/completions` manually.
</Note>

## Step 2: Select a Model (Auto-Fetched List)

Once you've entered the Base URL and API Key, Kilo Code automatically calls EvoLink's `/v1/models` endpoint and renders the available models into the model selector. You can search for and select the model you want in the selector, for example:

* Planning / complex reasoning: `claude-fable-5`
* Everyday execution: `claude-sonnet-5`
* Lightweight tasks: `claude-haiku-4-5-20251001`

<Note>
  **There are many models — use search to locate one.** EvoLink's `/v1/models` returns all available models (including image, video, music, and other types), so the list is long. Type `claude` directly in the selector to filter and quickly find the Claude family.
</Note>

## Step 3: Manually Add Context Window

The OpenAI Compatible provider's `/v1/models` returns only model IDs and **does not return the context window or maximum output**. When Kilo Code can't detect these capabilities, it falls back to conservative defaults, which may cause long sessions to be truncated prematurely.

The solution is to add a `limit` field for the models you use in Kilo Code's configuration file `kilo.jsonc` (located at `~/.config/kilo/kilo.jsonc` or in the project root as `./kilo.jsonc`).

<Warning>
  **`limit` must be nested under `provider.<providerID>.models.<modelID>` — it cannot be written as a bare top-level field.** A top-level `"limit": {...}` is not bound to any model, and Kilo won't apply it. The correct structure nests it per model (`<providerID>` is the Provider ID you entered when setting up the custom provider; for OpenAI Compatible it defaults to `openai-compatible`).
</Warning>

A complete, ready-to-use configuration (with all three models set up):

```jsonc theme={null}
{
  "$schema": "https://app.kilo.ai/config.json",
  "provider": {
    "openai-compatible": {
      "models": {
        "claude-fable-5": {
          "limit": { "context": 1000000, "output": 128000 }
        },
        "claude-sonnet-5": {
          "limit": { "context": 1000000, "output": 64000 }
        },
        "claude-haiku-4-5-20251001": {
          "limit": { "context": 200000, "output": 64000 }
        }
      }
    }
  }
}
```

Recommended values for each model:

| Model (key under `provider.openai-compatible.models`) | `limit.context` | `limit.output` |
| ----------------------------------------------------- | --------------- | -------------- |
| `claude-fable-5`                                      | 1000000         | 128000         |
| `claude-sonnet-5`                                     | 1000000         | 64000          |
| `claude-haiku-4-5-20251001`                           | 200000          | 64000          |

## Step 4: Verify the Configuration

After selecting a model, enter a simple question in the Kilo Code chat box to verify, for example:

```
who are you
```

**What success looks like:**

* The model replies with content normally.
* **No** errors such as `401`, `404`, or `model_not_found` appear.

## Advanced: Model Division of Labor with Multiple Configuration Profiles

Kilo Code supports creating multiple OpenAI Compatible provider profiles, where switching profiles switches the model. You can use this to implement a manual division of labor — "an expensive model for planning, a cheaper model for execution" — for example:

| Profile name | Model                       | Purpose                     |
| ------------ | --------------------------- | --------------------------- |
| `default`    | `claude-fable-5`            | Planning, complex reasoning |
| `heavy`      | `claude-opus-4-8`           | High-difficulty tasks       |
| `budget`     | `claude-haiku-4-5-20251001` | Lightweight execution       |

Switch to whichever profile matches the capability you need. All three profiles share the same EvoLink Base URL and key; only the model differs.

## Troubleshooting

The following is organized by **the actual error you see**.

### `401 unauthorized` (Invalid API key)

```
{"code":"unauthorized","message":"Invalid API key (request id: ...)"}
```

Possible causes:

* **The API Key includes the `Bearer ` prefix** (most common): Kilo Code adds Bearer automatically, so you only need to enter the raw key. Remove the prefix and re-enter it.
* The key itself is invalid or has been disabled: verify it in the [EvoLink console](https://evolink.ai/dashboard).

### `404 model_not_found`

```
{"code":"model_not_found","message":"Model '...' is not available for this API key ... Call GET /v1/models ..."}
```

Cause: the selected model ID doesn't match what `/v1/models` returns, or that model isn't enabled. Go back to the model selector and pick a model that actually exists in the list.

### Long sessions truncated prematurely / upstream reports context limit exceeded

Cause: the `limit` field wasn't added manually, so Kilo Code used a conservative default context window. Follow [Step 3](#step-3-manually-add-context-window) to fill in the real `context` / `output` values for the models you use.

### Too many models in the selector to find Claude

Just type `claude` in the selector's search box to filter. EvoLink's `/v1/models` returns all available models, so a long list is normal.

## FAQ

### 1. Should the API Key include the `Bearer` prefix?

No. Enter the **raw key** (the string starting with `sk-`). Kilo Code adds the `Bearer` authentication header automatically; including the prefix manually causes a double Bearer and returns `401`.

### 2. Should the Base URL be `/v1` or `/v1/chat/completions`?

Entering it up to the `/v1` root is sufficient (`https://direct.evolink.ai/v1`). Kilo Code appends the remaining path automatically.

### 3. Why do I need to add the context window manually?

The OpenAI Compatible `/v1/models` doesn't return the context window or maximum output, so Kilo Code uses conservative defaults when it can't detect them. Entering the real values manually in the `limit` field of `kilo.jsonc` avoids long sessions being truncated.

### 4. How do I use an expensive model for planning and a cheaper model for execution?

Create multiple OpenAI Compatible profiles (such as default/heavy/budget); switching profiles switches the model, all sharing the same EvoLink key.

### 5. Which common models does EvoLink support?

The full Claude family (it also supports GPT, Gemini, and more, which you can view in the console). Common ones: `claude-fable-5` (planning), `claude-sonnet-5` (execution), `claude-haiku-4-5-20251001` (lightweight).

### 6. How do I check usage?

Log in to the [EvoLink console](https://evolink.ai/dashboard) to view request volume, consumption, and token usage.

<Tip>
  For more usage and configuration, refer to the [Kilo Code VS Code documentation](https://kilo.ai/docs/code-with-ai/platforms/vscode).
</Tip>

<div style={{ height: "60vh" }} aria-hidden="true" />
