Kilo Code is an open-source agentic coding platform (~25K GitHub stars) that runs as a VS Code extension and a CLI. It bundles a long list of providers, but two paths matter when the model you want is not on that list or you want to route many models through one key: the OpenAI Compatible provider and the built-in OpenRouter aggregator.

This guide covers both. The OpenAI Compatible provider is the one to reach for when you have a gateway, a local runtime, or an internal endpoint and you want to supply the Base URL yourself. OpenRouter is the quicker path when you just want one key in front of a large public model menu.

Just want Haimaker in Kilo Code? Skip the manual settings — run npx -y @haimaker/connect --kilo and the CLI writes Kilo Code’s OpenAI Compatible provider config (endpoint, key, and model) for you, then exits. The two paths below are the general methods for wiring up any endpoint by hand. See the connect guide for the one-command path.

When to use each path

  • OpenAI Compatible — any endpoint that speaks the OpenAI chat completions format and where you control the Base URL. This is the path for Haimaker (one key across many model families), a local Ollama or LM Studio server, or a company-hosted gateway.
  • OpenRouter — a built-in aggregator. You paste a single OpenRouter key and choose from its model menu. Good when you want breadth fast and do not need a custom endpoint.

Both end up doing the same thing: sending OpenAI-format requests to a model. The difference is who owns the Base URL and how the credential is stored.

Path A: OpenAI Compatible provider (Haimaker, Ollama, internal gateways)

Step 1: Open settings and select the provider

Click the gear icon to open Kilo Code settings. Under API Provider, choose OpenAI Compatible. The form switches to the generic fields: Base URL, API Key, Model, and a Model Configuration section.

Step 2: Enter the Base URL and API key

  • Base URL — the provider’s endpoint. For Haimaker that is https://api.haimaker.ai/v1. Kilo Code accepts both the version-prefixed base (https://api.provider.com/v1) and a full chat-completions URL (https://api.provider.com/v1/chat/completions).
  • API Key — the secret key from your provider, pasted raw with no Bearer prefix.

Step 3: Set the Model

In the Model field, enter the exact model identifier the provider expects. Kilo Code passes this through unchanged, so it must match the upstream API. For Haimaker:

anthropic/claude-sonnet-4-6
openai/gpt-5.4-mini
minimax/minimax-m2.5
qwen/qwen3-coder

Step 4: Fill in Model Configuration

For an OpenAI Compatible provider, Kilo Code cannot detect a model’s capabilities, so it falls back to defaults. Open Model Configuration and set:

  • Context Window — the model’s real input limit.
  • Max Output Tokens — the per-response output cap.
  • Image Support — on only for multimodal models.
  • Computer Use — turn this on for models you want to drive agentic edits and tool calls. Left off, Kilo Code treats the model as chat-only and agentic actions fail.
  • Input / Output Pricing — the provider’s per-million-token rates, used for the in-session cost estimate only.

Getting Context Window and Computer Use right resolves most “connected but broken” cases.

Path B: OpenRouter

OpenRouter is built in, so the setup is shorter.

Step 1: Get an OpenRouter key

Sign in at openrouter.ai with Google or GitHub, open the keys page, and create a key. Copy it.

Step 2: Add it in Kilo Code

Open Settings (gear icon), go to the Providers tab, choose OpenRouter, and paste your key. The VS Code extension stores this in your kilo.json configuration file automatically. Then pick a model from the OpenRouter menu.

Editing kilo.json directly

If you prefer to edit config by hand, the OpenRouter block in kilo.json looks like this:

{
  "provider": {
    "openrouter": {
      "models": {
        "anthropic/claude-sonnet-4-20250514": {
          "options": {}
        }
      }
    }
  }
}

Anything under options passes straight through to the OpenRouter API without validation. Two useful ones:

  • "transforms": ["middle-out"] — OpenRouter’s middle-out compression, which helps when a conversation runs past the model’s context window.
  • Provider routingsort, order, only, and data_collection let you steer which upstream inference provider OpenRouter uses.

Testing it

Whichever path you used, confirm it resolves before pointing Kilo Code at real code:

  1. Pick the model in Kilo Code and send a small prompt in a throwaway task.
  2. If it fails, isolate the provider from the config by calling the API directly:
curl https://api.haimaker.ai/v1/models \
  -H "Authorization: Bearer your-haimaker-api-key"

A clean JSON list back means your key and endpoint are good and the issue is in the Kilo Code form. Use the exact id values from that response in the Model field.

Common errors and fixes

Model connects but agentic actions fail

Computer Use is off, so Kilo Code is treating the model as chat-only. Turn it on in Model Configuration. If it is on and tool calls still fail, the model may be weak at structured tool use; switch to one known for agentic coding.

Output truncates or you hit context errors

The Context Window or Max Output Tokens value does not match the model. Kilo Code used a default for the OpenAI Compatible provider. Set both to the model’s real limits.

Requests 404 or hit the wrong model

The Model ID does not match the upstream API. anthropic/claude-sonnet-4-6 and claude-sonnet-4-6 are different strings. Copy the exact id from the provider’s /models response.

Azure GPT-5 rejects the request

Do not use the OpenAI Compatible provider for Azure GPT-5 deployments. Azure GPT-5 rejects the max_tokens parameter that the OpenAI Compatible path sends. Use Kilo Code’s native Azure provider instead, and map deployment names with the model id field in kilo.json.

Long OpenRouter conversations error out

Add "transforms": ["middle-out"] under the model’s options in kilo.json so OpenRouter compresses the middle of the context instead of overflowing it.

How to access these models

You can reach the same models through more than one route. In rough order of how little configuration each takes:

  • haimaker.ai — one OpenAI-compatible key across many model families, with unified pricing and benchmarks; drop it into the OpenAI Compatible provider and switch models by changing one field.
  • OpenRouter — built into Kilo Code as an aggregator; one key, a large public menu, with kilo.json routing controls.
  • A provider’s own API — point the OpenAI Compatible Base URL straight at a single vendor when you only need one model family.
  • Local (Ollama / LM Studio) — run models on your machine via http://localhost:11434/v1 or http://127.0.0.1:1234/v1 for private work.

The practical setup

For most Kilo Code users, a small mix covers everything:

  1. Haimaker through the OpenAI Compatible provider for cloud models and one-key routing.
  2. Local models via Ollama for private work.
  3. One premium model for hard debugging and multi-file refactors.

That gives you breadth without juggling a dozen credentials, local privacy when it matters, and a stronger model on hand for the expensive tasks.

USE HAIMAKER WITH KILO CODE


Setting up a different agent? See Cline Custom Provider Setup, OpenCode Custom Provider Setup, and OpenClaw Custom Provider Setup for the same pattern. For help picking a model, see Best Models for OpenClaw.