# EZAT Router > One API key and one prepaid balance for leading AI models. Anthropic Messages API and OpenAI-compatible Chat Completions, pay as you go. Key facts: - Anthropic-compatible base URL: https://api.router.ezat.io (POST /v1/messages, POST /v1/messages/count_tokens, GET /v1/models) - OpenAI-compatible base URL: https://api.router.ezat.io/openai/v1 (POST /chat/completions, GET /models) - Auth: `x-api-key: ezat_sk_…` or `Authorization: Bearer ezat_sk_…` - Model ids are `author/model` (for example `anthropic/claude-sonnet-5-5`); Anthropic's own names work as aliases. List them with GET /v1/models. - Keys, balance and top-ups: https://router.ezat.io - Claude Code: set ANTHROPIC_BASE_URL=https://api.router.ezat.io and ANTHROPIC_AUTH_TOKEN= Full docs in one file: https://docs.router.ezat.io/llms-full.txt OpenAPI spec: https://docs.router.ezat.io/openapi.yaml Agent skill: https://docs.router.ezat.io/skill/ezat-router.zip (SKILL.md: https://docs.router.ezat.io/skill/ezat-router/SKILL.md) 中文: https://docs.router.ezat.io/zh/llms.txt ## Get started - [Introduction](https://docs.router.ezat.io/index.md): What EZAT Router is, its two API formats and their base URLs, and where to get an API key. - [Quickstart](https://docs.router.ezat.io/quickstart.md): Sign up, add credit, create an API key and send your first request with curl, Python or TypeScript. - [Authentication](https://docs.router.ezat.io/authentication.md): Send your ezat_sk_ key in x-api-key or Authorization Bearer, keep it safe, and fix 401 and 403 errors. ## APIs - [Anthropic Messages API](https://docs.router.ezat.io/anthropic/messages.md): Send requests in Anthropic's Messages format, streaming or not, count tokens, list models, and see which features are supported. - [OpenAI-compatible API](https://docs.router.ezat.io/openai/base-url.md): Base URL, authentication, endpoint mapping and SDK setup for tools and code that speak OpenAI's API format. - [Chat Completions](https://docs.router.ezat.io/openai/chat-completions.md): POST /openai/v1/chat/completions in detail - messages, streaming, tools, images, reasoning, caching, which fields are ignored or refused, and errors. - [Prompt caching and sessions](https://docs.router.ezat.io/guides/prompt-caching.md): How prompt caching saves money on EZAT Router, how to use it on both APIs, and why a conversation stays on one deployment. ## Models and pricing - [Models](https://docs.router.ezat.io/models.md): Every AI model you can call through EZAT Router, how model ids and aliases work, model statuses, what each feature means, and how to list models from the API. - [Pricing](https://docs.router.ezat.io/pricing.md): Live prices per million tokens for every model, what each price column means, long-context tiers, and how to work out a request's cost from its usage. ## Tools - [Claude Code](https://docs.router.ezat.io/tools/claude-code.md): Run Claude Code on your EZAT Router balance with two environment variables, ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN. - [OpenAI-format tools](https://docs.router.ezat.io/tools/openai-tools.md): Point tools and libraries that take a custom OpenAI base URL (Cline, Continue, LangChain, the Vercel AI SDK, LiteLLM) at EZAT Router. - [Switch from another provider](https://docs.router.ezat.io/tools/migrate.md): Move code from Anthropic's API or from an OpenAI-compatible router such as OpenRouter to EZAT Router, and what to check afterwards. ## Account and billing - [API keys](https://docs.router.ezat.io/api-keys.md): Create, name, copy and revoke API keys, and set a key's spend limit, model list and expiry. - [Organizations and members](https://docs.router.ezat.io/organizations.md): Organizations hold the balance, API keys and usage. Create and switch organizations, invite people, and what each role can do. - [How billing works](https://docs.router.ezat.io/billing.md): Prepaid credit per organization, top-ups through Stripe, automatic top-up, tax and invoices with tax IDs, how each request is charged (cache tokens, long context, interrupted streams), negative balances, the 402 error, and refunds. ## Examples - [curl](https://docs.router.ezat.io/examples/curl.md): Copy-paste curl requests for both API formats - a plain request, streaming, a tool call round trip, an image, counting tokens, listing models and handling errors. - [Node.js](https://docs.router.ezat.io/examples/node.md): Node.js examples with the Anthropic and OpenAI SDKs - a plain request, streaming, a tool call round trip, an image, counting tokens, listing models and handling errors. - [Python](https://docs.router.ezat.io/examples/python.md): Python examples with the Anthropic and OpenAI SDKs - a plain request, streaming, a tool call round trip, an image, counting tokens, listing models and handling errors. ## Reference - [Errors](https://docs.router.ezat.io/reference/errors.md): Every HTTP status and error type the gateway returns in the Anthropic and OpenAI formats, what causes each and whether to retry, errors during a stream, and the request ids to send to support. - [Rate limits](https://docs.router.ezat.io/reference/rate-limits.md): The per-key requests-per-minute limit, per-key spend limits, the organization balance, capacity limits, the headers that come back, and how to back off and retry. ## Anthropic Messages - [Create a message](https://docs.router.ezat.io/reference/api/createMessage.md): Sends a conversation to a model and returns its reply, in Anthropic's Messages format. Set `"stream": true` to receive the reply as Server-Sent Events. - [Count tokens](https://docs.router.ezat.io/reference/api/countMessageTokens.md): Counts the input tokens a Messages request would use, without running the model. It is free and isn't billed or listed in your usage, but it counts toward your key's requests per minute. ## OpenAI Chat Completions - [Create a chat completion](https://docs.router.ezat.io/reference/api/createChatCompletion.md): Sends a conversation to a model and returns its reply, in OpenAI's Chat Completions format. Set `"stream": true` to receive `chat.completion.chunk` events. ## Models - [List models (Anthropic format)](https://docs.router.ezat.io/reference/api/listModels.md): Lists the models your key can use, in Anthropic's format, with canonical `author/model` ids. A key restricted to some models lists only those. Deprecated models are listed while they are still served; models in preview only for keys allowed to use them. - [Get a model (Anthropic format)](https://docs.router.ezat.io/reference/api/getModel.md): Returns one model, looked up by canonical id or alias. The response always carries the canonical id. - [List models (OpenAI format)](https://docs.router.ezat.io/reference/api/listOpenAIModels.md): Lists the models your key can use, in OpenAI's format: the same models as `GET /v1/models`, with canonical `author/model` ids. `owned_by` is the part of the id before the slash. - [Get a model (OpenAI format)](https://docs.router.ezat.io/reference/api/getOpenAIModel.md): Returns one model, looked up by canonical id or alias. The response always carries the canonical id. Here the slash in a canonical id can be sent as it is (`/openai/v1/models/anthropic/claude-opus-5-5`) or encoded as `%2F`. - [List the model catalog](https://docs.router.ezat.io/reference/api/listCatalogModels.md): The public model catalog: every active and deprecated model, with its aliases, limits, capabilities and prices. No API key is needed. - [Changelog](https://docs.router.ezat.io/changelog.md): Dated, customer-visible changes to the EZAT Router API, dashboard, docs and agent skill, newest first. ## For AI agents - [Notes for AI agents](https://docs.router.ezat.io/agents.md): Required values, a safe setup procedure and a do-not list for AI agents that set up tools or code to use EZAT Router. - [Agent skill](https://docs.router.ezat.io/agents/skill.md): Install the ezat-router agent skill so Claude Code and other agents can set up and debug EZAT Router on their own. - [Troubleshooting](https://docs.router.ezat.io/troubleshooting.md): Common EZAT Router problems by symptom (wrong base URL, 401, 402, unknown model, 429 and 529, a tool ignoring your settings, cut-off streams) with the cause and the fix.