Skip to content
← All articles

Published November 14, 2026 · 7 min read

Roo Code, Kilo Code, Continue and Aider with an OpenAI-Compatible API (zrouter Setup)

Set up Roo Code, Kilo Code, Continue and Aider against zrouter's OpenAI-compatible endpoint: base URL, key, model name, and the small differences between the four tools.


Roo Code, Kilo Code, Continue and Aider all let you bring your own OpenAI-compatible endpoint. That means one zrouter key and one balance can power all four, and you can switch models without switching accounts.

The values are the same in every tool:

| Setting | Value | | --- | --- | | Base URL | https://api.zrouter.dev/v1 | | API key | your zr_ key from the dashboard | | Model | a zrouter model name, for example deepseek-v4.1-flash |

The sections below show where each tool puts those three values, and the one trap in each.

Roo Code

In the Roo Code settings panel, choose OpenAI Compatible as the API provider. The Roo Code documentation names the three things you must fill in: the Base URL, the API key and the Model ID. It also notes that the Base URL will not be https://api.openai.com/v1, which is for the official OpenAI API.

  • Base URL: https://api.zrouter.dev/v1
  • API Key: your zr_ key
  • Model ID: deepseek-v4.1-flash (or any model from the catalog)

The trap: the Model ID must be the zrouter name exactly. A name copied from another provider's catalog returns 404 model_not_found.

Kilo Code

Kilo Code's OpenAI-compatible provider takes a base URL, an optional API key and a list of models. Kilo can fetch the model list automatically when the URL exposes an OpenAI-compatible models endpoint, or you can add models by hand.

  • Base URL: https://api.zrouter.dev/v1
  • API key: your zr_ key
  • Models: select from the fetched list or add deepseek-v4.1-flash manually

The same page describes protocol choices for providers: Chat Completions for OpenAI-compatible endpoints, Responses for OpenAI and xAI models, and Anthropic Messages for Anthropic and MiniMax models. zrouter serves all three protocols. If a model misbehaves with one, test it with the plain Chat Completions option first.

The trap: keep /v1 in the base URL. The OpenAI-style endpoints live under /v1, so a base URL without it points at paths that do not exist.

Continue

Continue is configured in a YAML file. The Continue OpenAI provider page shows that for an OpenAI-compatible provider you keep provider: openai and change apiBase:

name: zrouter
version: 0.0.1
schema: v1
models:
  - name: DeepSeek V4.1 Flash (zrouter)
    provider: openai
    model: deepseek-v4.1-flash
    apiBase: https://api.zrouter.dev/v1
    apiKey: zr_your_key_here

You can add as many models as you like, each as its own entry with the same apiBase. That gives you a model dropdown made entirely of zrouter models.

The trap: provider stays openai even though the endpoint is not OpenAI. The provider field selects the protocol, not the company. Keep the key out of any config file you commit; if your setup supports secrets or environment variables for apiKey, use them.

Aider

Aider reads two environment variables, as the Aider documentation shows:

export OPENAI_API_BASE=https://api.zrouter.dev/v1
export OPENAI_API_KEY=zr_your_key_here
cd /path/to/your/project
aider --model openai/deepseek-v4.1-flash

On Windows use setx for both variables and restart the shell. Note the openai/ prefix: Aider needs it in front of the model name to route through the OpenAI-compatible path. The prefix is for Aider only; the model zrouter sees is deepseek-v4.1-flash.

The trap: Aider prints "Unknown context window size and costs" for models it has never heard of. Its warnings page explains that it then assumes an unlimited context window and that the model is free. The warning is usually harmless, but the cost Aider displays is not real. Your actual spend is in the zrouter usage page, which lists every request with its token counts and cost.

Choosing a model for coding work

A few starting points at the time of writing (14 November 2026, prices per 1M tokens, check the model pages for current numbers):

| Model | Input | Output | Context | | --- | --- | --- | --- | | deepseek-v4.1-flash | $0.015 | $0.06 | 1,000,000 tokens | | glm-5.3-flash | $0.015 | $0.05 | 1,000,000 tokens |

Both are 90% below the official price. For long-running agent sessions, a Token Plan ($1, $2, $5 or $10 per model) is spent before your pay-as-you-go balance, and neither expires.

When something fails

| Error | Meaning | | --- | --- | | 401 invalid_api_key | The key is wrong, expired or revoked. The gateway answers the same way for all three. | | 402 insufficient_balance | No Token Plan left for the model and an empty pay-as-you-go balance. Top up and retry. | | 402 key_daily_limit_reached | The key has a daily spend limit and reached it. It resets at 00:00 UTC. | | 404 model_not_found | The model name does not match the catalog, or the model is not visible. |

You can check any of these without the editor by calling the endpoint with curl:

curl https://api.zrouter.dev/v1/chat/completions \
  -H "Authorization: Bearer $ZROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4.1-flash","messages":[{"role":"user","content":"Hello"}],"max_tokens":512}'

Paying

Top up with QRIS, USDT or USDC, no credit card needed. QRIS checkouts can include a small service fee that is shown before you pay, and for USDT and USDC the sender pays the blockchain network fee.

Ready to start? Browse the models, check the pricing, or read the API docs.