How do I connect Kilo Code to a custom OpenAI-compatible API?

Last updated by the APIClaw team

In Kilo Code, add a Custom provider with Provider API set to OpenAI Compatible, Base URL https://apiclaw.biz/v1, your APIClaw key and a model ID such as claude-sonnet-5-5. Plans start at $19 a month for 500 requests a day, with no per-token billing and no cap on tokens per request.

What you are setting up

Kilo Code is a coding assistant that runs as a VS Code extension and as a command-line tool. It supports custom OpenAI-compatible providers, which means you can point it at any gateway that speaks the OpenAI format. APIClaw does, so every chat, edit and agent step Kilo Code performs is counted against your APIClaw plan instead of a per-token bill.

APIClaw plans run from $19 a month for 500 requests a day to $129 a month for 8,000 requests a day. Tokens per request are unlimited, which suits an agent that sends large contexts on every step. Requests per day are not unlimited, and the quota resets at 00:00 UTC.

Before you start

Install Kilo Code from the VS Code marketplace, or install the CLI. Create an account at /ui/signup/ and copy an API key from the dashboard. The free trial is 50 requests with no card, enough to confirm the setup. Open the model hub and copy an exact model ID. Kilo Code uses the plain ID, for example claude-sonnet-5-5. There is no apiclaw/ prefix here; that prefix is only for Cursor.

VS Code extension, step by step

  1. Open Kilo Code Settings and go to the Providers tab.
  2. Scroll to the bottom and click Custom provider.
  3. Fill in the dialog with the values below.
  4. Click Submit, then pick an APIClaw model in the model picker.
FieldValue
Provider IDapiclaw (any unique ID works)
Display nameAPIClaw
Provider APIOpenAI Compatible
Base URLhttps://apiclaw.biz/v1
API keyYour APIClaw key
ModelsPick from the fetched list, or paste an exact ID such as claude-sonnet-5-5

OpenAI Compatible is the simplest choice. APIClaw also serves the Responses API at https://apiclaw.biz/v1/responses, so the OpenAI Responses provider type works too if your Kilo build prefers it. Do not use the Anthropic provider type with this address. That type expects the Anthropic Messages base URL, which has no /v1 and is the one Claude Code uses.

Kilo CLI and the config file

Install the CLI and put your key in an environment variable:

bash
npm install -g @kilocode/cli
export APICLAW_API_KEY="sk-your-apiclaw-key"

The provider block belongs in the global file ~/.config/kilo/kilo.jsonc. Kilo resolves environment references only in the global config, so the same block in a project file fails to authenticate without a clear error.

json
{
  "$schema": "https://app.kilo.ai/config.json",
  "model": "openai-compatible/claude-sonnet-5-5",
  "provider": {
    "openai-compatible": {
      "options": {
        "baseURL": "https://apiclaw.biz/v1",
        "apiKey": "{env:APICLAW_API_KEY}"
      },
      "models": {
        "claude-sonnet-5-5": {
          "name": "claude-sonnet-5-5",
          "tool_call": true,
          "limit": { "context": 200000, "output": 16384 }
        }
      }
    }
  }
}

The numbers under limit are example values. Set them to the real context and output sizes of the model you choose. A custom model with no limit resolves to zero, which switches off conversation compaction and lets history grow until the request is rejected. Inside the CLI you can also run /connect to enter the credentials interactively, and kilo models to confirm the provider is active. The Kilo Code docs page keeps the current version of these steps.

Test the credentials without Kilo Code

When something fails, isolate the cause by sending the same request with curl. If this works, the key and the model ID are fine and the problem is in the Kilo settings.

bash
curl https://apiclaw.biz/v1/chat/completions \
  -H "Authorization: Bearer sk-your-apiclaw-key" \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-sonnet-5-5", "messages": [{"role": "user", "content": "Write a Python function that reverses a linked list."}]}'

A good response is JSON with a choices array holding the reply. Your dashboard lists your API keys and usage, so you can also confirm the call was counted.

Choosing a model in Kilo Code

Model IDWeightWhere it fits
deepseek-v4-flash1Quick questions, small edits
deepseek-v4-pro1Larger tasks on a budget of requests
claude-sonnet-5-52Daily coding and agent tasks
kimi-k32Alternative general coding model
claude-opus-5-53Hard refactors and long reasoning
gpt-6-sol3GPT-family alternative

Weight is the number of requests a call takes from your daily quota. On the $39 Pro plan (1,000 requests a day), claude-sonnet-5-5 gives 500 calls a day and deepseek-v4-flash gives 1,000. You choose the model in Kilo Code, and the gateway does not change it for you. If you want a cheaper model for simple work, switch it yourself in the picker.

Why flat-rate billing suits an agent extension

Kilo Code fires many requests, and each carries the conversation plus file contents. Under per-token billing, a long debugging session adds up quickly, and the cost depends on how much context the agent chooses to attach. Under a request quota, the cost of a day is the plan price divided across the month whether you send 20 or 400 calls, as long as you stay under the daily quota.

One honest caveat: at low volume, per-token billing is often cheaper than $19 a month. If you only use Kilo Code for a handful of prompts, test both. For comparison, Claude Sonnet 5.5 costs $2 input and $10 output per million tokens at the provider's list price, so a large agent turn can cost real money on a per-token plan. The flat-rate OpenAI-compatible API page explains the model in more depth, and one API key for all models shows how the same key works in other tools.

Troubleshooting

401 or invalid API key. Copy the key again with no spaces and no quotes inside the field. In the CLI, confirm that APICLAW_API_KEY is set in the shell you launched Kilo from. If the provider block is in a project file instead of the global config, authentication fails, so move it.

404 or connection error. The base URL must be exactly https://apiclaw.biz/v1. Do not append /chat/completions unless your Kilo build asks for a full endpoint URL. Do not use the Claude Code address https://apiclaw.biz here, because Kilo's OpenAI Compatible type needs the /v1 path.

Model not found. Use the exact ID from the model hub. Names like "claude" or "gpt-4o" are not valid. Do not add the apiclaw/ prefix in Kilo Code.

Context grows until requests fail. The model has no limit values in the CLI config. Add real context and output limits.

429 Too Many Requests. The daily quota is used. It resets at 00:00 UTC. Switch to a lighter model, wait, or move to a bigger plan. Claude Opus and GPT-6 Sol count as 3 requests per call, Claude Sonnet as 2.

Cursor uses the same OpenAI-style base URL but needs an apiclaw/ model prefix; see the Cursor docs. Claude Code uses the Anthropic-style address and is covered in the Claude Code docs. The main documentation index lists the rest, including Cline, Continue and Codex CLI.

Payment and independence

APIClaw takes cryptocurrency through NOWPayments and no card is needed. Plans last 30 days and can be cancelled at any time. APIClaw is independent and not affiliated with Anthropic, OpenAI, Google or Cursor. APIClaw routes requests to models available through publicly available sources and provider APIs.

Frequently asked questions

What Provider API should I pick in Kilo Code?

Pick OpenAI Compatible with the base URL https://apiclaw.biz/v1. The OpenAI Responses type also works because APIClaw serves the Responses API on the same base URL.

Kilo Code docs

Do I need the apiclaw/ prefix on the model name in Kilo Code?

No. Use the plain ID from the model hub, such as claude-sonnet-5-5. The apiclaw/ prefix is only needed in Cursor.

Why does my Kilo CLI config fail to authenticate?

The provider block must live in the global ~/.config/kilo/kilo.jsonc. Environment references are only resolved there, so the same block in a project file fails.

How many Kilo Code requests do I get per day?

Plans run from 500 requests a day at $19 a month to 8,000 at $129 a month. Claude Sonnet counts as 2 requests per call, Claude Opus as 3 and DeepSeek V4 as 1.

Model hub

Can I try Kilo Code with APIClaw for free?

Yes. The free trial gives 50 requests with no card, which is enough to configure Kilo Code and send a few test prompts.

Start the free trial

Ready to get started?

Every new account includes 50 free requests. No card required.

Create your free account