---
title: Kilo Code | Adaption
description: Use Adaption's hosted models and inference stacks as the inference provider in the Kilo Code CLI.
---

The [Kilo Code CLI](https://kilo.ai/cli) ships with Adaption as a built-in provider. Hosted models work as soon as Kilo can read your [Adaption API key](/introduction/create-api-keys/index.md). Inference stacks need one extra provider entry in your Kilo configuration.

You can also connect the [Adaption MCP server](/tools/mcp/index.md) separately to give Kilo tools for interacting with the Adaption Platform.

## Install Kilo

Terminal window

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

Check the install with `kilo --version`. This guide was tested with Kilo 7.8.

## Create and export an API key

1. [Sign in](https://adaptionlabs.ai/app/auth) to Adaption.

2. Open [**Settings**](https://adaptionlabs.ai/app/settings), then [**API keys**](https://adaptionlabs.ai/app/settings?tab=api_keys).

3. Create a key and copy it. You will not be able to view the key again.

4. Export it as `ADAPTION_API_KEY` so Kilo can read it automatically:

   Terminal window

   ```
   export ADAPTION_API_KEY="pt_live_..."
   ```

   To keep the key in Kilo’s credential store instead of your shell, run `kilo auth login`, choose **Adaption**, and paste the key.

Run `kilo auth list` to confirm Kilo sees the key. Adaption appears with `ADAPTION_API_KEY` next to it.

## Select a model

List the Adaption models Kilo knows about:

Terminal window

```
kilo models adaption
```

Every entry uses the `adaption/<model-id>` form, where `<model-id>` is a model ID from [Models](/inference-stacks/models/index.md). Send a one-off prompt to check the connection:

Terminal window

```
kilo run -m adaption/glm-5.2 "Explain this repository to me."
```

In the TUI, run `/models` and choose an Adaption entry. To make one the default, set the top-level `model` field in `~/.config/kilo/kilo.jsonc` (every project) or `kilo.jsonc` in a project directory:

\~/.config/kilo/kilo.jsonc

```
{
  "$schema": "https://app.kilo.ai/config.json",
  "model": "adaption/qwen3.5-397b",
}
```

API keys are bound to an organization, so no `X-Organization-Id` header is needed.

## Use an inference stack

An inference stack is a saved configuration of a model, tools, datasets, and memory. You call it with the model ID `stack/<slug>`, which Adaption shows on the stack’s page and returns as `model_id` when you list stacks.

Stacks are only served by the Responses API. The built-in Adaption provider sends requests to Chat Completions, so add a second provider that uses the Responses API and list your stacks under it:

\~/.config/kilo/kilo.jsonc

```
{
  "$schema": "https://app.kilo.ai/config.json",
  "provider": {
    "adaption-stacks": {
      "name": "Adaption stacks",
      "npm": "@ai-sdk/openai",
      "env": ["ADAPTION_API_KEY"],
      "options": {
        "baseURL": "https://api.prod.adaptionlabs.ai/api/v1",
      },
      "models": {
        "stack/support-assistant": {
          "name": "Support Assistant",
        },
      },
    },
  },
}
```

- `npm: "@ai-sdk/openai"` makes Kilo call the Responses API.
- `env` tells Kilo to send `ADAPTION_API_KEY` as `Authorization: Bearer ...`.
- Each key in `models` is sent to Adaption as the `model`, so it must match the stack’s `model_id` exactly.

Stacks belong to your account and cannot be discovered automatically. Add one entry per stack you want to use.

Select `adaption-stacks/stack/support-assistant` in `/models`, or run it directly:

Terminal window

```
kilo run -m adaption-stacks/stack/support-assistant "Summarize our open tickets."
```

See [Key concepts](/inference-stacks/key-concepts/index.md) for how a stack’s model, tools, datasets, and memory apply to each request.

Use the `provider` key, not `providers`. The published Kilo schema documents `providers`, but Kilo 7.8 rejects it with `Unrecognized key: providers`. Run `kilo config check` after editing to catch errors like this.

## Optional: connect the MCP server

The inference provider and the [Adaption MCP server](/tools/mcp/index.md) are separate. To let Kilo call Adaption’s dataset and AutoScientist tools, add the hosted MCP server at `https://api.prod.adaptionlabs.ai/api/v1/mcp`. See [MCP](/tools/mcp/index.md) for the complete tool catalog and sign-in steps.

## Troubleshooting

- **`The requested model is not available` for a stack.** The stack was called through the built-in `adaption` provider, which uses Chat Completions. Call it through the Responses provider from [Use an inference stack](#use-an-inference-stack) instead.
- **`Model not found: <provider>/<model>`.** Kilo has no entry for that model. For a stack, add its `stack/<slug>` under `models` and confirm with `kilo models adaption-stacks`. Check `kilo config check` too, because Kilo ignores a config file it cannot parse.
- **`environment references are not allowed in project config`.** A project `kilo.jsonc` cannot use `{env:...}` values. Use the provider’s `env` field, as in the example above.
- **Requests fail with `401`.** `ADAPTION_API_KEY` is not set in the shell that started Kilo, or the key was revoked. Run `kilo auth list` to check.
- **A request returns `502` or `503`.** The model provider could not complete the request. Wait and retry; if it persists, check the model’s status in the Adaption app.

## Next steps

- [Models](/inference-stacks/models/index.md): full list of hosted models, context lengths, and modalities.
- [Generate a model response](/inference-stacks/generate-a-model-response/index.md): conversation state, streaming, tools, and image inputs.
- [MCP](/tools/mcp/index.md): dataset and AutoScientist tools for Kilo’s MCP client.
