Skip to content
kenari.

Editors and AI agents

Any tool compatible with OpenAI or Anthropic can point to kenari by changing only the base URL and key. A list of valid model ids is at Models and pricing. To try without balance, add the :free suffix to the model id. step-3-7-flash:free is verified to return 200 on every wire below and does not debit balance, so the procedures on this page complete on a brand-new account with Rp 0.

Get the kn-... key from the dashboard (API keys -> Create key). The key is shown once and works for every model, every provider, and both APIs (OpenAI and Anthropic).

Base URLs at a glance:

  • OpenAI-compatible clients: https://kenari.id/v1
  • Claude Code (Anthropic protocol): https://kenari.id (Claude Code appends /v1 itself)

Follow these five steps before choosing a tool integration.

In the dashboard, open API keys, click Create key, and copy the kn-... value when it is displayed (it is not shown again). Rp 0 balance is enough for :free models, or top up via QRIS from Rp 1.000 for paid models.

Use an id from Models and pricing. For procedures that must work without balance, use step-3-7-flash:free. The key stays the same. Only the base URL and the model name change.

Continue with the tool section below.

Run the CLI or open the editor.

Pick a quick check from Troubleshooting. The two checks that fail most often are 401 (wrong or unread key) and 402 insufficient_balance (no balance for a paid model). Both are covered below.

Copy kn-... from the dashboard. No top up is needed for :free models.

Use step-3-7-flash:free so this completes without balance. For paid models, top up via QRIS from Rp 1.000.

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

Put the three lines in ~/.zshrc to make them stick, then open a new terminal. Verify the env is set without printing the key:

Terminal window
test -n "$ANTHROPIC_AUTH_TOKEN" && echo set

ANTHROPIC_BASE_URL is the root https://kenari.id (no /v1). Claude Code appends /v1 itself because it speaks the Anthropic protocol. ANTHROPIC_API_KEY (sent through the x-api-key header) is also accepted, and the count_tokens endpoint is available so Claude Code context tracking works.

This setup and the kenari CLI are two ways to do the same thing, so pick one. The manual setup here routes every Claude Code session at one model. The CLI routes a single session and can put a different model behind each slot. kenari claude takes over the three variables above for the session it starts and tells you it did, so you can leave them in place while you try it.

Terminal window
claude

Send any message. If Claude Code reports 401 invalid x-api-key, the env did not load (the new terminal was never opened or ~/.zshrc was not sourced). If it reports model_not_found, the model id was typed wrong. Use exactly step-3-7-flash:free from Models and pricing. If it reports 402 insufficient_balance, the model is not a :free one. Switch to a free model or top up balance.

Copy kn-... from the dashboard.

Use step-3-7-flash:free. Top up for paid models.

Create or edit ~/.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 the key in your shell:

Terminal window
export KENARI_API_KEY=kn-...

wire_api = "responses" uses /v1/responses, the only wire recent Codex CLI versions support. wire_api = "chat" was removed. requires_openai_auth = false pairs with env_key. With the key stored in ~/.codex/auth.json, use requires_openai_auth = true and omit env_key. See Responses for details.

Terminal window
codex

Send a short prompt to Codex. 401 invalid api key means KENARI_API_KEY did not load. Check echo $KENARI_API_KEY (it will print kn-..., which is the env check). model_not_found means the id is wrong. Use exactly step-3-7-flash:free. A wrong base URL shape (https://kenari.id/v1/v1/chat/completions or missing /v1) returns 405, not 404. The path must be exactly https://kenari.id/v1.

Claude Code Router (CCR, musistudio/claude-code-router) accepts a ccr://provider?... link that adds a provider through a confirmation dialog. On a machine with CCR installed, open add Kenari to CCR and CCR shows a preview before saving. The kn-... key is not in the URL: CCR asks for it during confirmation.

If the link does nothing, CCR is not installed or the ccr:// scheme is not registered. Use the Claude Code guide with env vars instead.

Open OpenCode, type /connect, find Kenari in the provider list, paste kn-..., then pick a model from the list (including step-3-7-flash:free). If you prefer environment variables, export KENARI_API_KEY=kn-... is also recognized without /connect. The opencode.json configuration format is owned by OpenCode, see OpenCode docs for details.

Run omniroute setup (or open the OmniRoute dashboard), find Kenari in the provider list, paste kn-.... Every catalog model is available through the OmniRoute endpoint right away, including OmniRoute’s own cross-provider fallback rules. The OmniRoute setup format is in the OmniRoute docs.

Hermes (Nous Research) accepts an OpenAI-compatible endpoint. The base URL ends in /v1 and the key is read from OPENAI_API_KEY. The exact Hermes CLI form is in the Hermes docs. Configuration differs across versions.

OpenClaw takes a custom provider through the flags --custom-base-url, --custom-provider-id, --custom-model-id, and --custom-compatibility. The base URL ends in /v1, and the key goes into the OpenClaw configuration as apiKey: "kn-...". The exact OpenClaw CLI and configuration format is in the OpenClaw docs.

Open Zoo Code Settings (the gear icon), pick Kenari in the “API Provider” dropdown, paste kn-..., then choose a model. The model list is fetched automatically from /v1/models, so the catalog stays current with no extension update. Official guide: docs.zoocode.dev/providers/kenari.

kenari has an MCP server at https://kenari.id/mcp (Streamable HTTP). Besides docs tools and the model list, this server provides three web tools that are billed directly to your balance:

  • kenari_web_search: search the web directly, returning title, URL, and snippet, limited to 10 results.
  • kenari_web_fetch: fetch one URL, then return clean text from that page.
  • kenari_x_search: search recent posts on X, then return a short answer, safe x.com source links, and the billed cost.

All three tools need an API key. Set the key in the Authorization header on your MCP server, then the tools can be called directly from any agent:

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

kenari_x_search requires a non-empty query. Its optional x_search_filter matches POST /v1/x/search:

  • allowed_x_handles or excluded_x_handles: limit the X accounts, at most 20 handles without @, and not usable together.
  • from_date, to_date: date range in YYYY-MM-DD format.
  • enable_image_understanding, enable_video_understanding: read media inside posts.

Successful searches and fetches are billed per call according to the rate set by the operator. kenari_x_search uses the PAYG balance, with no plan allowance. Failed calls are not billed. Each successful kenari_x_search result includes the amount actually debited.

SymptomCauseFix
401 invalid api key or 401 invalid x-api-keywrong key, env did not load, or terminal was not opened after editing ~/.zshrcre-copy kn-... from the dashboard. Open a new terminal after editing ~/.zshrc. Run test -n "$ANTHROPIC_AUTH_TOKEN" && echo set
model_not_foundid was typed wrong or is not in the cataloguse exactly step-3-7-flash:free, or pick from Models and pricing
402 insufficient_balancepaid model used with Rp 0 balanceswitch to a :free model or top up via QRIS from Rp 1.000
405 from https://kenari.id/v1/v1/... or missing /v1wrong base URL shapeOpenAI-style must be https://kenari.id/v1. Claude Code must be https://kenari.id