# Integrations overview

Any tool that speaks the OpenAI or Anthropic API can use kenari by changing the base URL and the key. One `kn-` key works for every model and for both API formats. Create it under **API Keys** in the dashboard. See [Authentication and API keys](/en/docs/authentication).

## Base URLs

| Client type | Base URL | Examples |
| --- | --- | --- |
| OpenAI-compatible SDKs and tools | `https://kenari.id/v1` | OpenAI SDKs, OpenCode, Zoo Code, Hermes, OpenClaw, Kimi Code |
| OpenAI Responses clients | `https://kenari.id/v1` | Codex |
| Anthropic SDKs and Claude Code | `https://kenari.id` | Anthropic SDKs, Claude Code |

The Anthropic row is for the Anthropic SDKs and Claude Code, which add `/v1/messages` themselves, so their base URL has no `/v1`. If you add it, requests go to `/v1/v1/messages` and return `405`.

```python
import os
import anthropic
from openai import OpenAI

openai_client = OpenAI(base_url="https://kenari.id/v1", api_key=os.environ["KENARI_API_KEY"])
anthropic_client = anthropic.Anthropic(base_url="https://kenari.id", api_key=os.environ["KENARI_API_KEY"])
```

Valid model ids are listed in [Models and pricing](/en/docs/models). To test with zero balance, use a `:free` model such as `step-3-7-flash:free`.

## Dedicated guides

- [Claude Code](/en/docs/claude-code): three environment variables.
- [Codex](/en/docs/codex): a provider in `config.toml`.
- [kenari CLI](/en/docs/cli): mix native and kenari models per role.
- [magpie](/en/docs/magpie): add kenari to magpie with one import link.
- [MCP server](/en/docs/mcp): docs, model list and web tools for any MCP client.
- [Docs for AI agents](/en/docs/agent-docs): `llms.txt`, Markdown pages and OpenAPI.

## Claude Code Router

Claude Code Router (CCR) can add kenari as a provider from a link. On a machine with CCR installed, open [add kenari to CCR](ccr://provider?manifest=https%3A%2F%2Fkenari.id%2F.well-known%2Fccr-provider.json). The link points CCR at a public manifest at `https://kenari.id/.well-known/ccr-provider.json`. The manifest holds the base URL, the API format and the chat models that support function calling, so you set nothing by hand. CCR shows a preview before it saves anything, and asks for your `kn-` key in the confirmation dialog. The key is not part of the link or the manifest.

The manifest needs no key and refreshes every few minutes. CCR reads it when you open the link, so open the link again to pick up new models.

If the link does nothing, CCR is not installed or does not handle the `ccr://` scheme. Use [Claude Code](/en/docs/claude-code) with environment variables instead.

## OpenCode

In OpenCode, type `/connect`, pick **Kenari** from the provider list, paste your key, and choose a model. Setting `KENARI_API_KEY` in your environment also works without `/connect`. For `opencode.json` configuration, follow the [OpenCode docs](https://opencode.ai/docs).

## OmniRoute

Run `omniroute setup` or open the OmniRoute dashboard, pick **Kenari** from the provider list, and paste your key. Every catalog model becomes available through your OmniRoute endpoint, together with OmniRoute's own fallback rules. See the [OmniRoute docs](https://omniroute.dev).

## Zoo Code

Open Zoo Code settings, pick **Kenari** under **API Provider**, paste your key, and choose a model. Zoo Code loads the model list from `/v1/models`, so new models appear without an extension update. See the [Zoo Code guide](https://docs.zoocode.dev/providers/kenari).

## Hermes

Hermes accepts an OpenAI-compatible endpoint. Use `https://kenari.id/v1` as the base URL and your kenari key as `OPENAI_API_KEY`. The exact setup differs between versions, so follow the [Hermes docs](https://hermes.nousresearch.com/docs).

## OpenClaw

OpenClaw takes a custom provider through the flags `--custom-base-url`, `--custom-provider-id`, `--custom-model-id` and `--custom-compatibility`. Set the base URL to `https://kenari.id/v1` and the key to your `kn-` key. See the [OpenClaw docs](https://openclaw.dev) for the exact format.

## Kimi Code

Kimi Code can import kenari as a provider from a public registry. Run:

```bash
kimi provider add https://kenari.id/.well-known/models.dev.json
```

The registry lists every kenari chat model with its context window, its longest output, and whether it reads images and calls functions. It needs no key and refreshes every few minutes. Kimi Code checks the same URL again on later starts, so new models appear without another command.

The import does not store your key. Add one line to the `[providers.kenari]` section of `~/.kimi-code/config.toml`, and export the key in your shell:

```toml
api_key_env = "KENARI_API_KEY"
```

Then pick a kenari model with `/model`, or start Kimi Code with `-m` and a model name from the list. The registry shows `0` for prices because kenari bills in Rupiah. See [Models and pricing](/en/docs/models) for the real prices. For the other options of `kimi provider`, follow the [Kimi Code docs](https://moonshotai.github.io/kimi-code/en/reference/kimi-command).

## Troubleshooting

| Symptom | Cause | Fix |
| --- | --- | --- |
| `401` with `invalid key` or `missing authorization` | The key is not set, did not load, or does not start with `kn-`. | Copy the key again from **API Keys**, then restart the tool or open a new terminal. |
| `400` with `model_not_found` | The model id is misspelled or not in the catalog. | Copy the id from [Models and pricing](/en/docs/models). |
| `402` with `insufficient_balance` | The model is paid and your available balance cannot cover the estimated cost of the request. | Use a `:free` model, shorten the prompt, or top up. See [How a chat request is charged](/en/docs/billing#how-a-chat-request-is-charged). |
| `405` | The base URL has the wrong shape, such as `/v1/v1` or a missing `/v1`. | Use `https://kenari.id/v1` for OpenAI-compatible clients and `https://kenari.id` for the Anthropic SDKs and Claude Code. In CCR, keep the base URL from its integration link. |

## See also

- [Quickstart](/en/docs/quickstart)
- [Models and pricing](/en/docs/models)
- [Errors](/en/docs/errors)
- [Rate limits](/en/docs/rate-limits)
