# kenari > kenari is an LLM gateway. One endpoint speaks both the OpenAI and the Anthropic API, routes to many model providers, meters usage per token, and bills in Indonesian Rupiah from a prepaid balance. Bring your own provider key (BYOK) and the matching traffic is forwarded for free. Base URL: `https://kenari.id/v1`. Authenticate with `Authorization: Bearer kn-...` using a key created in the dashboard. Pricing is per token in IDR; top up via QRIS from Rp 1,000. ## Instructions for AI Agents - Append `.md` to any docs URL for clean Markdown (for example, https://kenari.id/docs/chat.md). - `https://kenari.id/docs.md` is the entire documentation in one Markdown file; `https://kenari.id/llms-full.txt` is the full reference. Markdown is far cheaper in tokens than HTML. - `https://kenari.id/openapi.json` is the OpenAPI 3.1 spec for the /v1 API (feeds code generators and API explorers). - `GET https://kenari.id/v1/models` is public and returns the live model list with per-token IDR pricing. Query it instead of hardcoding models or prices. - MCP server: `https://kenari.id/mcp` exposes read tools `kenari_search_docs` and `kenari_list_models` (public), `kenari_balance`, `kenari_usage` and `kenari_quota` (set Authorization: Bearer kn-... on the MCP server), read tools `kenari_workspace_members`, `kenari_workspace_seats` and `kenari_workspace_invites` (same header, for a key created with a workspace access level), plus billed tools `kenari_web_search`, `kenari_web_fetch`, and `kenari_x_search` (same header, charged to the wallet per call). ## Docs - [Quickstart](https://kenari.id/docs/quickstart) ([.md](https://kenari.id/docs/quickstart.md)): Create a key, send your first request with a free model, then call kenari from code. - [Authentication and API keys](https://kenari.id/docs/authentication) ([.md](https://kenari.id/docs/authentication.md)): Send your API key, call from a browser, restrict keys by model or spend, share keys, and revoke them. - [Function calling](https://kenari.id/docs/function-calling) ([.md](https://kenari.id/docs/function-calling.md)): Give the model a list of functions, receive function calls, and send the results back. - [Structured output](https://kenari.id/docs/structured-output) ([.md](https://kenari.id/docs/structured-output.md)): Ask for valid JSON or JSON that matches a schema on Chat completions, Responses and Messages. - [Images and files as input](https://kenari.id/docs/vision) ([.md](https://kenari.id/docs/vision.md)): Send images and documents to any model, or let a model read them itself. - [Read documents](https://kenari.id/docs/documents) ([.md](https://kenari.id/docs/documents.md)): Attach a PDF, text file or image to any model, billed as ordinary tokens. Paid OCR is opt-in. - [Streaming](https://kenari.id/docs/streaming) ([.md](https://kenari.id/docs/streaming.md)): Receive answers incrementally over Server-Sent Events in all three API formats. - [Reasoning](https://kenari.id/docs/reasoning) ([.md](https://kenari.id/docs/reasoning.md)): Control how much a model thinks, read its reasoning trace, and keep the cost in check. - [Prompt caching](https://kenari.id/docs/prompt-caching) ([.md](https://kenari.id/docs/prompt-caching.md)): How prompt caching works, how to read it in usage, and how it is priced. - [Server tools](https://kenari.id/docs/server-tools) ([.md](https://kenari.id/docs/server-tools.md)): Add web search, page fetch, X search and the current time to any model. - [Routing and routes](https://kenari.id/docs/routing) ([.md](https://kenari.id/docs/routing.md)): Automatic fallback between providers, plus named routes you build yourself. - [Providers](https://kenari.id/docs/byok) ([.md](https://kenari.id/docs/byok.md)): Connect your own API keys and AI subscriptions to kenari, and fall back to your balance when they run out. - [Rate limits](https://kenari.id/docs/rate-limits) ([.md](https://kenari.id/docs/rate-limits.md)): Requests per minute, free-model limits, concurrency limits, and how to retry. - [Chat completions](https://kenari.id/docs/chat) ([.md](https://kenari.id/docs/chat.md)): POST /v1/chat/completions, compatible with OpenAI Chat Completions. - [Messages](https://kenari.id/docs/messages) ([.md](https://kenari.id/docs/messages.md)): POST /v1/messages and count_tokens, compatible with Anthropic Messages. - [Claude Managed Agents](https://kenari.id/docs/claude-managed-agents) ([.md](https://kenari.id/docs/claude-managed-agents.md)): Use Anthropic Managed Agents, Files, Skills and Message Batches through kenari with your own Anthropic API key. - [Responses](https://kenari.id/docs/responses) ([.md](https://kenari.id/docs/responses.md)): POST /v1/responses, a stateless subset of OpenAI Responses for Codex and similar agents. - [Models and pricing](https://kenari.id/docs/models) ([.md](https://kenari.id/docs/models.md)): GET /v1/models: the model list, capabilities, and prices in Rupiah. - [Model changes](https://kenari.id/docs/model-changes) ([.md](https://kenari.id/docs/model-changes.md)): GET /v1/models/changes: new and retired models, price changes, discounts, plan changes and model revisions, on a public feed, a web page and Telegram. - [Embeddings](https://kenari.id/docs/embeddings) ([.md](https://kenari.id/docs/embeddings.md)): POST /v1/embeddings, compatible with OpenAI Embeddings. - [Rerank](https://kenari.id/docs/rerank) ([.md](https://kenari.id/docs/rerank.md)): POST /v1/rerank: order documents by relevance to a query. - [Moderations](https://kenari.id/docs/moderations) ([.md](https://kenari.id/docs/moderations.md)): POST /v1/moderations, compatible with OpenAI Moderations. - [Images](https://kenari.id/docs/images) ([.md](https://kenari.id/docs/images.md)): POST /v1/images/generations and /v1/images/edits, compatible with OpenAI Images. - [Text to speech](https://kenari.id/docs/audio-speech) ([.md](https://kenari.id/docs/audio-speech.md)): POST /v1/audio/speech: turn text into audio. - [Transcriptions](https://kenari.id/docs/audio-transcriptions) ([.md](https://kenari.id/docs/audio-transcriptions.md)): POST /v1/audio/transcriptions: turn audio into text. - [Music](https://kenari.id/docs/music) ([.md](https://kenari.id/docs/music.md)): POST /v1/music/generations: make a song from lyrics or an instrumental track from a description. - [Videos](https://kenari.id/docs/videos) ([.md](https://kenari.id/docs/videos.md)): POST /v1/videos/generations and /v1/videos/extensions, then poll for the result. - [OCR](https://kenari.id/docs/ocr) ([.md](https://kenari.id/docs/ocr.md)): POST /v1/ocr: extract text from a document without a model. - [System One](https://kenari.id/docs/systemone) ([.md](https://kenari.id/docs/systemone.md)): POST /v1/systemone: evaluate a state with typed questions. - [Web and X search](https://kenari.id/docs/web-search) ([.md](https://kenari.id/docs/web-search.md)): POST /v1/web/search, /v1/web/fetch and /v1/x/search without a model. - [Errors](https://kenari.id/docs/errors) ([.md](https://kenari.id/docs/errors.md)): Error formats, every error code, and how to handle each one. - [Account overview](https://kenari.id/docs/account) ([.md](https://kenari.id/docs/account.md)): Which endpoint answers which question: balance, plan quota and usage history, and which keys may read them. - [Account balance](https://kenari.id/docs/account-balance) ([.md](https://kenari.id/docs/account-balance.md)): GET /v1/account/balance: your account's current Rupiah balance. - [Account quota](https://kenari.id/docs/account-quota) ([.md](https://kenari.id/docs/account-quota.md)): GET /v1/account/quota: the active plan, remaining quota windows, and coupons. - [Per-tool keys](https://kenari.id/docs/account-keys) ([.md](https://kenari.id/docs/account-keys.md)): GET and POST /v1/account/keys, DELETE /v1/account/keys/{id}: give each tool its own key under your kenari login key. - [Usage](https://kenari.id/docs/usage) ([.md](https://kenari.id/docs/usage.md)): GET /v1/usage, /v1/usage/daily and /v1/usage/log: usage and cost per model, per day and per request. - [Workspace API](https://kenari.id/docs/workspace-api) ([.md](https://kenari.id/docs/workspace-api.md)): Manage a team workspace with an API key: members, invites, seats, PAYG limits and moving Personal balance. - [Notifications](https://kenari.id/docs/notifications) ([.md](https://kenari.id/docs/notifications.md)): Get quota, plan and balance alerts in Telegram or a webhook, and read the same numbers from scripts and agents. - [How billing works](https://kenari.id/docs/billing) ([.md](https://kenari.id/docs/billing.md)): Prepaid balance, top up, PAYG, price dimensions, and what each endpoint is billed by. - [Free models](https://kenari.id/docs/free-models) ([.md](https://kenari.id/docs/free-models.md)): The :free models, the kenari-free route, and daily quotas for free, paying and subscribed accounts. - [Subscriptions](https://kenari.id/docs/subscriptions) ([.md](https://kenari.id/docs/subscriptions.md)): Plans, quota windows, covered models, free cache, and what happens when quota runs out. - [Plan gifts](https://kenari.id/docs/gifts) ([.md](https://kenari.id/docs/gifts.md)): Buy a month of a plan for someone else, send the gift link, and use a gift you received. - [Codes and referral](https://kenari.id/docs/codes-referral) ([.md](https://kenari.id/docs/codes-referral.md)): Redeem promo, trial and top-up bonus codes, and earn cashback from friends you invite. - [Integrations overview](https://kenari.id/docs/integrations) ([.md](https://kenari.id/docs/integrations.md)): Base URLs for each kind of client, and how to connect OpenCode, Zoo Code and other tools. - [Claude Code](https://kenari.id/docs/claude-code) ([.md](https://kenari.id/docs/claude-code.md)): Point Claude Code at kenari with three environment variables. - [Codex](https://kenari.id/docs/codex) ([.md](https://kenari.id/docs/codex.md)): Point Codex CLI at kenari through config.toml. - [kenari CLI](https://kenari.id/docs/cli) ([.md](https://kenari.id/docs/cli.md)): Mix native and kenari models per role in one Claude Code, Codex or Grok session. - [magpie](https://kenari.id/docs/magpie) ([.md](https://kenari.id/docs/magpie.md)): Add kenari to magpie with one import link, or with one terminal command. - [MCP server](https://kenari.id/docs/mcp) ([.md](https://kenari.id/docs/mcp.md)): Connect agents to the kenari MCP server for docs, models, account data, search, files, generation and embeddings. - [Docs for AI agents](https://kenari.id/docs/agent-docs) ([.md](https://kenari.id/docs/agent-docs.md)): llms.txt, llms-full.txt, Markdown pages, and the OpenAPI spec. - [Domains](https://kenari.id/docs/domains) ([.md](https://kenari.id/docs/domains.md)): Register, manage DNS, renew and transfer .id and other domains. - [Pods](https://kenari.id/docs/pods) ([.md](https://kenari.id/docs/pods.md)): Container hosting for ready-made apps, billed monthly from your balance. - [Media kit](https://kenari.id/docs/media-kit) ([.md](https://kenari.id/docs/media-kit.md)): kenari logos, colors, typography and brand rules. - [Full reference](https://kenari.id/llms-full.txt): every page in one file. Read this first if you are an agent. ## Docs (English) - [Quickstart](https://kenari.id/en/docs/quickstart) ([.md](https://kenari.id/en/docs/quickstart.md)): Create a key, send your first request with a free model, then call kenari from code. - [Authentication and API keys](https://kenari.id/en/docs/authentication) ([.md](https://kenari.id/en/docs/authentication.md)): Send your API key, call from a browser, restrict keys by model or spend, share keys, and revoke them. - [Function calling](https://kenari.id/en/docs/function-calling) ([.md](https://kenari.id/en/docs/function-calling.md)): Give the model a list of functions, receive function calls, and send the results back. - [Structured output](https://kenari.id/en/docs/structured-output) ([.md](https://kenari.id/en/docs/structured-output.md)): Ask for valid JSON or JSON that matches a schema on Chat completions, Responses and Messages. - [Images and files as input](https://kenari.id/en/docs/vision) ([.md](https://kenari.id/en/docs/vision.md)): Send images and documents to any model, or let a model read them itself. - [Read documents](https://kenari.id/en/docs/documents) ([.md](https://kenari.id/en/docs/documents.md)): Attach a PDF, text file or image to any model, billed as ordinary tokens. Paid OCR is opt-in. - [Streaming](https://kenari.id/en/docs/streaming) ([.md](https://kenari.id/en/docs/streaming.md)): Receive answers incrementally over Server-Sent Events in all three API formats. - [Reasoning](https://kenari.id/en/docs/reasoning) ([.md](https://kenari.id/en/docs/reasoning.md)): Control how much a model thinks, read its reasoning trace, and keep the cost in check. - [Prompt caching](https://kenari.id/en/docs/prompt-caching) ([.md](https://kenari.id/en/docs/prompt-caching.md)): How prompt caching works, how to read it in usage, and how it is priced. - [Server tools](https://kenari.id/en/docs/server-tools) ([.md](https://kenari.id/en/docs/server-tools.md)): Add web search, page fetch, X search and the current time to any model. - [Routing and routes](https://kenari.id/en/docs/routing) ([.md](https://kenari.id/en/docs/routing.md)): Automatic fallback between providers, plus named routes you build yourself. - [Providers](https://kenari.id/en/docs/byok) ([.md](https://kenari.id/en/docs/byok.md)): Connect your own API keys and AI subscriptions to kenari, and fall back to your balance when they run out. - [Rate limits](https://kenari.id/en/docs/rate-limits) ([.md](https://kenari.id/en/docs/rate-limits.md)): Requests per minute, free-model limits, concurrency limits, and how to retry. - [Chat completions](https://kenari.id/en/docs/chat) ([.md](https://kenari.id/en/docs/chat.md)): POST /v1/chat/completions, compatible with OpenAI Chat Completions. - [Messages](https://kenari.id/en/docs/messages) ([.md](https://kenari.id/en/docs/messages.md)): POST /v1/messages and count_tokens, compatible with Anthropic Messages. - [Claude Managed Agents](https://kenari.id/en/docs/claude-managed-agents) ([.md](https://kenari.id/en/docs/claude-managed-agents.md)): Use Anthropic Managed Agents, Files, Skills and Message Batches through kenari with your own Anthropic API key. - [Responses](https://kenari.id/en/docs/responses) ([.md](https://kenari.id/en/docs/responses.md)): POST /v1/responses, a stateless subset of OpenAI Responses for Codex and similar agents. - [Models and pricing](https://kenari.id/en/docs/models) ([.md](https://kenari.id/en/docs/models.md)): GET /v1/models: the model list, capabilities, and prices in Rupiah. - [Model changes](https://kenari.id/en/docs/model-changes) ([.md](https://kenari.id/en/docs/model-changes.md)): GET /v1/models/changes: new and retired models, price changes, discounts, plan changes and model revisions, on a public feed, a web page and Telegram. - [Embeddings](https://kenari.id/en/docs/embeddings) ([.md](https://kenari.id/en/docs/embeddings.md)): POST /v1/embeddings, compatible with OpenAI Embeddings. - [Rerank](https://kenari.id/en/docs/rerank) ([.md](https://kenari.id/en/docs/rerank.md)): POST /v1/rerank: order documents by relevance to a query. - [Moderations](https://kenari.id/en/docs/moderations) ([.md](https://kenari.id/en/docs/moderations.md)): POST /v1/moderations, compatible with OpenAI Moderations. - [Images](https://kenari.id/en/docs/images) ([.md](https://kenari.id/en/docs/images.md)): POST /v1/images/generations and /v1/images/edits, compatible with OpenAI Images. - [Text to speech](https://kenari.id/en/docs/audio-speech) ([.md](https://kenari.id/en/docs/audio-speech.md)): POST /v1/audio/speech: turn text into audio. - [Transcriptions](https://kenari.id/en/docs/audio-transcriptions) ([.md](https://kenari.id/en/docs/audio-transcriptions.md)): POST /v1/audio/transcriptions: turn audio into text. - [Music](https://kenari.id/en/docs/music) ([.md](https://kenari.id/en/docs/music.md)): POST /v1/music/generations: make a song from lyrics or an instrumental track from a description. - [Videos](https://kenari.id/en/docs/videos) ([.md](https://kenari.id/en/docs/videos.md)): POST /v1/videos/generations and /v1/videos/extensions, then poll for the result. - [OCR](https://kenari.id/en/docs/ocr) ([.md](https://kenari.id/en/docs/ocr.md)): POST /v1/ocr: extract text from a document without a model. - [System One](https://kenari.id/en/docs/systemone) ([.md](https://kenari.id/en/docs/systemone.md)): POST /v1/systemone: evaluate a state with typed questions. - [Web and X search](https://kenari.id/en/docs/web-search) ([.md](https://kenari.id/en/docs/web-search.md)): POST /v1/web/search, /v1/web/fetch and /v1/x/search without a model. - [Errors](https://kenari.id/en/docs/errors) ([.md](https://kenari.id/en/docs/errors.md)): Error formats, every error code, and how to handle each one. - [Account overview](https://kenari.id/en/docs/account) ([.md](https://kenari.id/en/docs/account.md)): Which endpoint answers which question: balance, plan quota and usage history, and which keys may read them. - [Account balance](https://kenari.id/en/docs/account-balance) ([.md](https://kenari.id/en/docs/account-balance.md)): GET /v1/account/balance: your account's current Rupiah balance. - [Account quota](https://kenari.id/en/docs/account-quota) ([.md](https://kenari.id/en/docs/account-quota.md)): GET /v1/account/quota: the active plan, remaining quota windows, and coupons. - [Per-tool keys](https://kenari.id/en/docs/account-keys) ([.md](https://kenari.id/en/docs/account-keys.md)): GET and POST /v1/account/keys, DELETE /v1/account/keys/{id}: give each tool its own key under your kenari login key. - [Usage](https://kenari.id/en/docs/usage) ([.md](https://kenari.id/en/docs/usage.md)): GET /v1/usage, /v1/usage/daily and /v1/usage/log: usage and cost per model, per day and per request. - [Workspace API](https://kenari.id/en/docs/workspace-api) ([.md](https://kenari.id/en/docs/workspace-api.md)): Manage a team workspace with an API key: members, invites, seats, PAYG limits and moving Personal balance. - [Notifications](https://kenari.id/en/docs/notifications) ([.md](https://kenari.id/en/docs/notifications.md)): Get quota, plan and balance alerts in Telegram or a webhook, and read the same numbers from scripts and agents. - [How billing works](https://kenari.id/en/docs/billing) ([.md](https://kenari.id/en/docs/billing.md)): Prepaid balance, top up, PAYG, price dimensions, and what each endpoint is billed by. - [Free models](https://kenari.id/en/docs/free-models) ([.md](https://kenari.id/en/docs/free-models.md)): The :free models, the kenari-free route, and daily quotas for free, paying and subscribed accounts. - [Subscriptions](https://kenari.id/en/docs/subscriptions) ([.md](https://kenari.id/en/docs/subscriptions.md)): Plans, quota windows, covered models, free cache, and what happens when quota runs out. - [Plan gifts](https://kenari.id/en/docs/gifts) ([.md](https://kenari.id/en/docs/gifts.md)): Buy a month of a plan for someone else, send the gift link, and use a gift you received. - [Codes and referral](https://kenari.id/en/docs/codes-referral) ([.md](https://kenari.id/en/docs/codes-referral.md)): Redeem promo, trial and top-up bonus codes, and earn cashback from friends you invite. - [Integrations overview](https://kenari.id/en/docs/integrations) ([.md](https://kenari.id/en/docs/integrations.md)): Base URLs for each kind of client, and how to connect OpenCode, Zoo Code and other tools. - [Claude Code](https://kenari.id/en/docs/claude-code) ([.md](https://kenari.id/en/docs/claude-code.md)): Point Claude Code at kenari with three environment variables. - [Codex](https://kenari.id/en/docs/codex) ([.md](https://kenari.id/en/docs/codex.md)): Point Codex CLI at kenari through config.toml. - [kenari CLI](https://kenari.id/en/docs/cli) ([.md](https://kenari.id/en/docs/cli.md)): Mix native and kenari models per role in one Claude Code, Codex or Grok session. - [magpie](https://kenari.id/en/docs/magpie) ([.md](https://kenari.id/en/docs/magpie.md)): Add kenari to magpie with one import link, or with one terminal command. - [MCP server](https://kenari.id/en/docs/mcp) ([.md](https://kenari.id/en/docs/mcp.md)): Connect agents to the kenari MCP server for docs, models, account data, search, files, generation and embeddings. - [Docs for AI agents](https://kenari.id/en/docs/agent-docs) ([.md](https://kenari.id/en/docs/agent-docs.md)): llms.txt, llms-full.txt, Markdown pages, and the OpenAPI spec. - [Domains](https://kenari.id/en/docs/domains) ([.md](https://kenari.id/en/docs/domains.md)): Register, manage DNS, renew and transfer .id and other domains. - [Pods](https://kenari.id/en/docs/pods) ([.md](https://kenari.id/en/docs/pods.md)): Container hosting for ready-made apps, billed monthly from your balance. - [Media kit](https://kenari.id/en/docs/media-kit) ([.md](https://kenari.id/en/docs/media-kit.md)): kenari logos, colors, typography and brand rules. - [Full reference](https://kenari.id/llms-full.txt): every page in one file. Read this first if you are an agent. ## API - [OpenAPI 3.1 spec](https://kenari.id/openapi.json): the full request and response contract. - `GET /v1/models`: List models and live pricing - `GET /v1/models/changes`: List recent catalog changes - `GET /v1/tools`: List the agent tools - `POST /v1/chat/completions`: Create a chat completion - `POST /v1/messages`: Create a message - `POST /v1/messages/count_tokens`: Count input tokens - `POST /v1/responses`: Create a response - `POST /v1/images/generations`: Generate an image - `POST /v1/images/edits`: Edit an image (image-to-image) - `POST /v1/embeddings`: Create embeddings - `POST /v1/moderations`: Classify content - `POST /v1/rerank`: Rerank documents - `POST /v1/systemone`: Evaluate a System One model - `POST /v1/audio/speech`: Text to speech - `POST /v1/audio/transcriptions`: Speech to text - `POST /v1/audio/translations`: Translate speech into English - `POST /v1/music/generations`: Generate a song - `POST /v1/videos/generations`: Generate a video - `POST /v1/videos/extensions`: Extend an existing video - `GET /v1/videos/{id}`: Poll a video job - `GET /v1/videos/{id}/content`: Download a finished video - `POST /v1/web/search`: Search the web - `POST /v1/x/search`: Search X (Twitter) - `POST /v1/ocr`: Read a document to text - `GET /v1/account/quota`: Get plan and coupon quota - `GET /v1/account/balance`: Get wallet balance - `POST, GET /v1/account/keys`: Create a per-tool key - `DELETE /v1/account/keys/{id}`: Revoke a per-tool key - `GET /v1/usage`: Get usage summary - `GET /v1/usage/daily`: Get daily usage - `GET /v1/usage/log`: List requests - `POST /v1/web/fetch`: Fetch a URL - `GET, PATCH /v1/workspace`: Get the workspace - `GET /v1/workspace/members`: List members - `PATCH, DELETE /v1/workspace/members/{user_id}`: Change a member's role - `PUT /v1/workspace/members/{user_id}/cap`: Set a member's PAYG limit - `PUT /v1/workspace/member-cap-default`: Set the PAYG limit for new members - `GET, POST /v1/workspace/invites`: List pending invites - `DELETE /v1/workspace/invites/{id}`: Revoke an invite - `GET, POST /v1/workspace/seats`: List seats - `POST /v1/workspace/seats/quote`: Quote a seat purchase - `POST /v1/workspace/seats/reactivate`: Reactivate lapsed seats - `PATCH, DELETE /v1/workspace/seats/{id}`: Assign or change a seat - `POST /v1/workspace/seats/{id}/cancel-change`: Cancel a pending seat change - `POST /v1/workspace/fund-from-personal`: Fund the workspace from Pribadi ## Features - Named routes: build an ordered fallback pool in the dashboard, then send its name as the `model` field. The built-in route `kenari-free` falls through the currently free models at no cost. - BYOK: register a provider key or connect a ChatGPT, Claude or Grok subscription in the dashboard; requests served by your own account are free, usage is still logged. - Billing: every metered request debits IDR from the account balance. No balance returns HTTP 402 `insufficient_balance`. ## Free tier - 23 free models. Quotas are per account and cover every `:free` model: - New account: 50 requests per day, 5 per minute - After topping up Rp 10,000: 1,000 requests per day, 10 per minute - Active plan: no daily cap, 25 per minute