# Use Kilo Code with a 5abeer API key: custom provider setup

> Add 5abeer to Kilo Code as an OpenAI Compatible custom provider, paste your API key and run Claude, GPT or Gemini models from your balance.

Updated: 2026-11-01

To use Kilo Code with 5abeer, open Settings, go to the Providers tab and add a Custom provider. Set Provider API to OpenAI Compatible, the Base URL to `https://api.5abeer.ai/v1`, paste your 5abeer API key, and add a model id such as `claude-sonnet-5.5`. Every request is then paid from your 5abeer balance.

## What you need

- Kilo Code in VS Code, or the Kilo CLI in a terminal. Both read the same provider settings.
- A 5abeer API key for the provider of the model you will use. A key works with one provider's models only, so a Claude key runs Claude models ([create a key](https://5abeer.ai/en/docs/start/keys.md#create)).
- Some balance on your account ([how to pay](https://5abeer.ai/en/docs/start/payment.md)).

A 5abeer subscription key will not work here. Plans are for the supported apps, and Kilo Code is not one of them. To use the models from Kilo Code, create an API key that is paid from your balance.

## Which Kilo Code API provider to choose

Kilo Code's custom provider dialog has a Provider API setting with three protocols: OpenAI Compatible, OpenAI Responses and Anthropic Messages. Choose OpenAI Compatible. 5abeer serves the OpenAI Chat Completions format at `/v1` for Claude, GPT and Gemini models, so this one setting covers every model, as long as the key matches the model's provider.

The built-in Anthropic and OpenAI entries in Kilo's provider list are for keys from those companies. Their setup pages ask only for an API key, so use a custom provider for 5abeer instead.

| Format | Base URL | Key header |
| --- | --- | --- |
| OpenAI | `https://api.5abeer.ai/v1` | `Authorization: Bearer <KEY>` |
| Anthropic | `https://api.5abeer.ai` | `x-api-key: <KEY>` |
| Gemini | `https://api.5abeer.ai/v1beta` | `x-goog-api-key: <KEY>` |

## Set up the Kilo Code API key in VS Code

### 1. Create a 5abeer API key

In the dashboard, open **API → Keys**, choose **New key** and pick the provider. For the example below, pick Claude. Copy the key when it appears.

### 2. Open the custom provider dialog

In Kilo Code, open **Settings** (the gear icon) and go to the **Providers** tab. Scroll to the bottom and click **Custom provider**.

### 3. Fill in the fields

- **Provider ID**: a short lowercase id, for example `khabeer`. Kilo uses it in the `provider_id/model_id` format.
- **Display name**: the name you want to see in the model picker, for example 5abeer.
- **Provider API**: **OpenAI Compatible**.
- **Base URL**: `https://api.5abeer.ai/v1`
- **API key**: your 5abeer key.
- **Models**: add `claude-sonnet-5.5`. Type the id exactly as it appears on the [models list](https://5abeer.ai/en/models). If Kilo fetches a list for you, check each id against the models list before you add it.
- **Headers**: leave empty. Kilo sends the key for you.

### 4. Save and pick the model

Click **Submit**. The provider's models appear in the model picker. Pick the 5abeer model and send a short request. If a reply comes back, the setup works.

Kilo's docs say token limits and other per-model options live in its `kilo.jsonc` config file. If you set the context window or max output there, take the values from the model's page, for example [`claude-sonnet-5.5`](https://5abeer.ai/en/models/claude-sonnet-5.5), instead of guessing.

## Use the Kilo CLI with the same key

The Kilo CLI installs with `npm install -g @kilocode/cli` and reads `kilo.json` or `kilo.jsonc` from `~/.config/kilo/` or from your project folder. Define 5abeer in the global file in `~/.config/kilo/` and keep the key in an environment variable. Kilo resolves `{env:...}` keys only in the global config, not in a project file:

```json
{
  "model": "khabeer/claude-sonnet-5.5",
  "provider": {
    "khabeer": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "https://api.5abeer.ai/v1",
        "apiKey": "{env:KHABEER_API_KEY}"
      },
      "models": {
        "claude-sonnet-5.5": {}
      }
    }
  }
}
```

Set `KHABEER_API_KEY` in the terminal you start `kilo` from. The `model` value uses the `provider_id/model_id` format. You can add `name` and `limit` to the model entry; take the limits from the model's page.

## Which model to pick in Kilo Code

Start with [`claude-sonnet-5.5`](https://5abeer.ai/en/models/claude-sonnet-5.5) for everyday coding. Move to [`claude-opus-5.5`](https://5abeer.ai/en/models/claude-opus-5.5) for long, hard tasks where the extra cost pays off. These are the current Claude models:

| Model | Id | Input (ours) | Output (ours) | Context |
| --- | --- | --- | --- | --- |
| Claude Sonnet 5.5 | `claude-sonnet-5.5` | $0.60 | $3 | 1M |
| Claude Opus 5.5 | `claude-opus-5.5` | $1.20 | $6 | 1M |
| Claude Fable 5.1 | `claude-fable-5.1` | $3 | $15 | — |

The official price next to ours, with the date it was read:

Claude Sonnet 5.5 (`claude-sonnet-5.5`) per 1M tokens: input $0.60 (official $2), output $3 (official $10). Official price checked October 19, 2026.

For GPT or Gemini models, you need a key for that provider, and their ids are on the [models list](https://5abeer.ai/en/models). See the next section.

## Claude and GPT in Kilo Code: one key per provider

Each 5abeer key works with one provider's models. If you call a GPT model with a Claude key, the request returns [`MODEL_PLATFORM_NOT_ALLOWED`](https://5abeer.ai/en/docs/help/errors.md#MODEL_PLATFORM_NOT_ALLOWED).

To use both in Kilo Code, create a second key for GPT and add a second custom provider, for example `khabeer-gpt`, with the same Provider API and the same Base URL. Add GPT model ids to it. Both providers then show up in the model picker, and both keys draw on the same balance. The same pattern works for Gemini.

## Keep Kilo Code API costs under control

Each request is paid from your balance by the tokens it uses, at the model's 5abeer price ([pricing and balance](https://5abeer.ai/en/docs/start/pricing.md)). An agent can send many requests in one task, so set limits on the key itself. You can control every key: a spend limit, an expiry date and an IP allow-list ([key controls](https://5abeer.ai/en/docs/start/keys.md#controls)). A separate key for Kilo Code also keeps its usage apart from your other tools in the dashboard.

Kilo also sells its own hosted access. Its pricing page describes the Kilo Gateway as "Pay-as-you-go hosted AI inference with no subscription" at "exact provider rates with no markup", with a 5% processing fee on credit purchases, and it also supports bringing your own provider keys ([kilo.ai/pricing](https://kilo.ai/pricing), checked 2026-11-01). With the setup above, Kilo sends requests straight to 5abeer and they are paid from your 5abeer balance.

## Common errors and fixes

- [`INVALID_API_KEY`](https://5abeer.ai/en/docs/help/errors.md#INVALID_API_KEY) or a 401: the key is wrong or was revoked. Paste it again in the provider dialog. In the CLI, check that `KHABEER_API_KEY` is set in that terminal.
- [`MODEL_PLATFORM_NOT_ALLOWED`](https://5abeer.ai/en/docs/help/errors.md#MODEL_PLATFORM_NOT_ALLOWED): the model belongs to another provider than the key. Use the matching key, or add a second provider.
- Wrong base URL: for OpenAI Compatible, use `https://api.5abeer.ai/v1`, with `/v1` and nothing after it.
- Model not found: the model id has a typo or a different spelling. Copy it from the [models list](https://5abeer.ai/en/models).
- [`INSUFFICIENT_BALANCE`](https://5abeer.ai/en/docs/help/errors.md#INSUFFICIENT_BALANCE): your balance doesn't cover the request. Top up and retry.

Every code and what it means is in [Errors and fixes](https://5abeer.ai/en/docs/help/errors.md).

## Questions

### Can I use my 5abeer subscription in Kilo Code?

No. Plans run only the supported apps, and Kilo Code is not one of them. Create an API key and pay for Kilo Code usage from your balance.

### Is the built-in Anthropic provider the right choice for a 5abeer Claude key?

No. Kilo's Anthropic setup page asks for an API key from Anthropic and shows no base URL field. Add 5abeer as a custom provider with OpenAI Compatible instead; Claude models work through it with a Claude key.

### Why do I need two keys for Claude and GPT?

A 5abeer key works with one provider's models only. Create one key per provider, add one custom provider per key, and both use the same balance.

### Can Kilo Code fetch the 5abeer model list?

Kilo tries to fetch models when you enter a Base URL and key, and you can click **Fetch models** to retry. Whatever the list shows, check each id against the 5abeer models list, or type the id yourself.

### Do I need Kilo credits to use my own key?

Not for this setup. Kilo's pricing page lists bring-your-own-key use next to its own gateway. With 5abeer as a custom provider, requests are paid from your 5abeer balance.

### Is the Kilo CLI set up the same way?

Yes, with a config file instead of the dialog. Add the provider under `provider` in `kilo.jsonc`, with `options.baseURL`, `options.apiKey` and at least one model.

> Ready to connect Kilo Code? [Create an API key](https://5abeer.ai/en/docs/start/keys.md#create) for the provider you want, then see every model and price on the [5abeer API page](https://5abeer.ai/en/api). Setting up a similar tool? See [Cline](https://5abeer.ai/en/guides/cline-api-key) and [Roo Code](https://5abeer.ai/en/guides/roo-code-api-key).

## Sources

Checked on 2026-11-01:

- Kilo Code docs: [Using OpenAI Compatible providers](https://kilo.ai/docs/ai-providers/openai-compatible), [Custom models](https://kilo.ai/docs/code-with-ai/agents/custom-models), [Anthropic](https://kilo.ai/docs/ai-providers/anthropic) and [CLI](https://kilo.ai/docs/cli)
- Kilo docs source on GitHub: [Kilo-Org/kilocode](https://github.com/Kilo-Org/kilocode)
- Kilo pricing: [kilo.ai/pricing](https://kilo.ai/pricing)
- 5abeer docs: [API keys](https://5abeer.ai/en/docs/start/keys.md), [Base URLs](https://5abeer.ai/en/docs/start/base-urls.md) and [Errors and fixes](https://5abeer.ai/en/docs/help/errors.md)

> 5abeer is an independent service, not affiliated with Kilo Code, OpenAI, Anthropic or Google.
