All posts

Point your editor at kenari

kenari team6 min read
Point your editor at kenari

Claude Code speaks the Anthropic protocol, Codex speaks the OpenAI one, and whatever you install next month will want an account of its own.

One kn- key and one kenari base URL cover all of them instead, and swapping models after that is a string change rather than an integration rewrite.

n8n has its own post, Point n8n at kenari, since it is a different kind of setup. This one stays with editors.

One key, two protocols

kenari accepts both protocols your tools already use, so nothing on your side has to change.

OpenAI-compatible clients (Codex, OpenCode, Zoo Code, the SDK already in your project) point at https://kenari.id/v1, while Claude Code uses the Anthropic protocol and takes https://kenari.id with no /v1, because it appends /v1 itself.

Pick the right shape and put a kn- key in the header.

Get it backwards and the base URL becomes https://kenari.id/v1/v1/..., or an OpenAI client goes out without its /v1, and the response is usually 405 rather than 404.

Try first without balance

API Keys page

Sign in to the dashboard, open API keys, and click Create key. It starts with kn- and is shown exactly once, so copy it before you close the tab. That single key covers every model, every provider, and both APIs.

Trying this needs no top up, because adding the :free suffix to a model id keeps the request off your balance. Every procedure below uses step-3-7-flash:free for that reason, and a new account at Rp 0 can run all of them. There is a per-account limit, and the free path makes no promise of matching a paid model on speed. Picking an id is covered in Try a free model first.

The live list of ids is at GET /v1/models, which is public and needs no key, so read from it rather than hard-coding ids the catalog will move under you.

Claude Code

Three lines in the shell, and if you want them to stick, put them in ~/.zshrc and open a new terminal:

export ANTHROPIC_BASE_URL=https://kenari.id
export ANTHROPIC_AUTH_TOKEN=kn-...
export ANTHROPIC_MODEL=step-3-7-flash:free

Then run claude and send any message.

401 invalid x-api-key usually means the env did not load, model_not_found means the id has a typo, so check it reads exactly step-3-7-flash:free, and 402 insufficient_balance means the model is not :free while the balance is still Rp 0.

ANTHROPIC_API_KEY, sent through the x-api-key header, is accepted too, and count_tokens is available, so Claude Code keeps tracking context as usual.

Codex

Recent Codex CLI versions only support /v1/responses, and wire_api = "chat" has been removed, so an older config will stop working. In ~/.codex/config.toml:

model = "step-3-7-flash:free"
model_provider = "kenari"

[model_providers.kenari]
name = "kenari"
base_url = "https://kenari.id/v1"
wire_api = "responses"
env_key = "KENARI_API_KEY"
requires_openai_auth = false
export KENARI_API_KEY=kn-...
codex

The key comes from the env here, not from an OpenAI account, and if yours is already stored in ~/.codex/auth.json, set requires_openai_auth = true and drop env_key.

Other tools, same pattern

OpenCode takes it through /connect: pick Kenari from the list and paste your kn-..., or export KENARI_API_KEY=kn-... if you would rather stay in the shell.

Zoo Code keeps it in settings: pick Kenari as the provider, paste the key, choose a model. It fetches that model list from /v1/models, so the catalog stays current.

Hermes, OpenClaw, OmniRoute, and Claude Code Router all follow the same pattern, base URL plus key, with exact steps in the editor docs.

One kn- runs all of them, and the only value that moves is model: claude-sonnet-5, gpt-5-5, gemini-3-7-flash, or a route name you built in the dashboard.

One session, a different model per role

To run a different model per role instead of one model for the whole session, use the official CLI.

npm install -g @kenarihq/cli
kenari login
kenari claude

kenari login opens an approval page in the browser, then stores the key in ~/.kenari/credentials.json once you accept. Roles are set by kenari configure: native stays on the original provider, while values prefixed kenari/ go through kenari. The wrapper writes nothing into your Claude Code or Codex config, and kenari status --check confirms it.

The env setup above and the CLI are two paths to the same thing, so pick one and stop there. kenari claude takes over the three Anthropic variables for the session it starts, which means you can leave them in place.

MCP, if your agent needs tools

The kenari MCP server is at https://kenari.id/mcp. Without a key, an agent can search the docs (kenari_search_docs) and list models (kenari_list_models), and with an Authorization: Bearer kn-... header it can also read balance and usage, then call kenari_web_search, kenari_web_fetch, and kenari_x_search. Those last three bill per successful call, and a failed call costs you nothing.

{
  "mcpServers": {
    "kenari": {
      "url": "https://kenari.id/mcp",
      "headers": { "Authorization": "Bearer kn-..." }
    }
  }
}

If you get stuck

Four codes account for almost everything people write in about:

  • 401: the key is wrong, truncated, or the env never loaded. Copy kn-... again and open a new terminal.
  • model_not_found: the id has a typo. Take one straight from GET /v1/models.
  • 402 insufficient_balance: a paid model against an Rp 0 balance. Switch to :free, or top up first.
  • 405: the base URL shape is wrong. OpenAI-style has to be https://kenari.id/v1, and Claude Code has to be https://kenari.id.