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

# Kilo Code

> Use Edgee with the Kilo Code CLI to route every terminal coding session through the gateway.

Edgee's OpenAI-compatible API works with [Kilo Code](https://kilocode.ai), letting you use its terminal agent while routing every request through Edgee for compression and observability.

## Edgee CLI setup (recommended)

The fastest way to connect Kilo Code to Edgee is the CLI. It authenticates, hands Kilo an Edgee provider populated from the live Edgee model catalog, and starts the agent — no config file to edit by hand.

<Steps>
  <Step title="Install Kilo Code">
    ```bash theme={"dark"}
    npm install -g @kilocode/cli
    ```

    This installs the `kilo` binary (also available as `kilocode`).
  </Step>

  <Step title="Install the Edgee CLI">
    <Tabs>
      <Tab title="macOS / Linux">
        ```bash theme={"dark"}
        curl -fsSL https://edgee.ai/install.sh | bash
        ```
      </Tab>

      <Tab title="Homebrew (macOS)">
        ```bash theme={"dark"}
        brew install edgee-ai/tap/edgee
        ```
      </Tab>

      <Tab title="Windows (PowerShell)">
        ```powershell theme={"dark"}
        irm https://edgee.ai/install.ps1 | iex
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Launch Kilo Code through Edgee">
    ```bash theme={"dark"}
    edgee launch kilo
    ```

    The CLI authenticates, adds the `edgee` provider, and starts Kilo Code. Token compression is enabled automatically. Pick an Edgee model from Kilo's model picker, or pass one directly:

    ```bash theme={"dark"}
    edgee launch kilo -- -m edgee/anthropic/claude-sonnet-4-5
    ```
  </Step>
</Steps>

After the session ends, the CLI prints a link to view token usage, compression savings, and cost breakdown in the Edgee Console.

<Note>
  Everything after `kilo` is forwarded to the agent untouched, so `edgee launch kilo -- run --auto "..."` works exactly like `kilo run --auto "..."`. Run `edgee alias` to install a `kilo` shim, and plain `kilo` routes through Edgee from then on.
</Note>

### Your own config is never modified

Unlike integrations that write into your configuration files, `edgee launch kilo` passes the Edgee provider to the agent **inline**, through the [`KILO_CONFIG_CONTENT`](https://kilocode.ai/docs/code-with-ai/platforms/cli#environment-variables) environment variable, which Kilo deep-merges over your own configuration.

Two things follow. Your Edgee API key is **never written to disk** — it exists only in the environment of the Kilo process that Edgee starts. And nothing you have configured is touched, moved, or re-emitted: your `~/.config/kilo/kilo.json`, your project `kilo.json`, your agents, commands and skills are all read by Kilo exactly as usual. Edgee contributes one provider and nothing else.

Because `KILO_CONFIG_CONTENT` ranks above project-level configuration in Kilo's precedence order, a `kilo.json` committed in a repository cannot shadow the Edgee provider.

### Model context windows and pricing

Each model the CLI writes into the `edgee` provider carries its context window and its per-million-token rates, read from the Edgee model catalog:

```json theme={"dark"}
{
  "models": {
    "anthropic/claude-sonnet-4-5": {
      "name": "anthropic/claude-sonnet-4-5",
      "limit": { "context": 1000000, "output": 32000 },
      "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }
    }
  }
}
```

Those are Claude Sonnet 4.5's catalog values: a 1M context window, $3 and $15 per million input and output tokens, $0.30 per million cached-read tokens, $3.75 per million cache-write tokens.

Why it matters: Kilo defaults both to `0` for a config-defined model. Without `limit`, its context gauge and auto-compaction have nothing to measure against; without `cost`, every session reports as free.

Details on what the CLI emits:

* `limit.context` comes from the catalog. When a model is served by several LLM providers with different windows, the value is the author's own provider entry, or the smallest declared window when the author doesn't serve it — overstating the window makes the agent compact too late and the request gets rejected.
* `limit.output` is always `32000`. Kilo clamps every request's `max_tokens` to its own 32k ceiling anyway, and its schema requires `output` whenever `limit` is set.
* `cost` is in US dollars per million tokens, the same unit as Kilo's own catalog. A model that is genuinely free gets zeroed rates rather than an omitted `cost`.
* Tiered long-context pricing is not emitted. Kilo's schema has a `cost.context_over_200k` slot, but its config merge drops that field, so declaring it would imply a tier that never takes effect.
* Models the catalog has no entry for keep working; they just ship without `limit` or `cost`. The fetch is best-effort — if it fails, launch continues with no declared metadata.

## Manual setup (advanced)

Prefer to configure Kilo Code yourself? Open or create `~/.config/kilo/kilo.json` and add the following configuration:

```json theme={"dark"}
{
  "$schema": "https://app.kilo.ai/config.json",
  "provider": {
    "edgee": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Edgee",
      "options": {
        "baseURL": "https://edgee.io/v1",
        "apiKey": "sk-edgee-..."
      },
      "models": {
        "anthropic/claude-sonnet-4-5": {
          "name": "claude sonnet 4.5 (edgee)",
          "limit": { "context": 1000000, "output": 32000 },
          "cost": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 }
        },
        "openai/gpt-5.2": {
          "name": "gpt-5.2 (edgee)",
          "limit": { "context": 400000, "output": 32000 },
          "cost": { "input": 1.75, "output": 14, "cache_read": 0.175, "cache_write": 0 }
        }
      }
    }
  }
}
```

Make sure to replace `"sk-edgee-..."` with your actual Edgee API key.

Keep the `/v1` on `baseURL`: Kilo speaks the OpenAI Chat Completions API and does not append the version segment itself.

Model ids use the `provider/model` form the Edgee catalog exposes. `limit` and `cost` are optional, but a model without them gets no context gauge, no auto-compaction, and a `$0` cost readout — the same reason `edgee launch kilo` declares them for you. Keep `limit.output` at `32000`: Kilo clamps `max_tokens` to that ceiling regardless.

<Tip>
  To keep your key out of the config file, store it in an environment variable and reference it as `"apiKey": "{env:EDGEE_API_KEY}"`. Kilo resolves `{env:...}` only in trusted configuration — your global config, or one supplied through `KILO_CONFIG` / `KILO_CONFIG_CONTENT` — never in a project file committed to a repository.
</Tip>

## Usage

Once configured, select an Edgee model from Kilo's picker, or pass it on the command line:

```bash theme={"dark"}
kilo -m edgee/anthropic/claude-sonnet-4-5
```

Model ids are namespaced by the provider key, so every Edgee model appears as `edgee/<provider>/<model>`. Run `kilo models edgee` to list the ones currently available to you.

## Authentication

Edgee uses standard Bearer token authentication. The API key configured in `kilo.json` — or supplied by `edgee launch kilo` — authenticates requests to the Edgee API.

Kilo's own `kilo auth` login is independent and untouched: launching through Edgee adds a provider rather than redirecting the one you already signed in to, so you can switch back at any time by picking a non-Edgee model.

<Note>
  Token compression is only available when routing through Edgee. You can use your own provider keys via [BYOK](/docs/features/byok) — compression still applies as long as requests go through Edgee.
</Note>

## Benefits of Using Kilo Code with Edgee

<CardGroup cols={2}>
  <Card title="Unified Infrastructure" icon="server">
    Access all LLM providers through Edgee while using Kilo Code's terminal agent.
  </Card>

  <Card title="Cost Control" icon="dollar-sign">
    Leverage Edgee's cost tracking and routing while working in Kilo Code.
  </Card>

  <Card title="Reliability" icon="shield-check">
    Combine Kilo Code's agent capabilities with Edgee's automatic failover and load balancing.
  </Card>

  <Card title="Observability" icon="chart-line">
    Monitor your Kilo Code sessions with Edgee's built-in observability features.
  </Card>
</CardGroup>

## Next Steps

* Explore [Kilo Code's documentation](https://kilocode.ai/docs/code-with-ai/platforms/cli) for more features
* Set up [observability](/docs/features/observability) to monitor your Kilo Code sessions

<EdgeeSdk />
