Get started
AZRouter API
Point the OpenAI or Anthropic SDK you already use at AZRouter, then call any model in the catalog by its slug.
- Your code. An OpenAI or Anthropic SDK, or curl
- base_url. api.azrouter.dev
- AZRouter. Checks the key, prices each unit
- Provider. Runs the model
- Response. OpenAI or Anthropic JSON or SSE, with usage
Providers in the catalog: Anthropic, OpenAI, Google, SpaceXAI, Moonshot AI
AZRouter serves models from many providers through a single gateway, billed per unit from prepaid credits.
Your code keeps its SDK: you change the base URL and the key, and you pick a model by its slug, such as qwen/.
The gateway speaks two wire formats:
- OpenAI: Chat Completions, Responses, Embeddings, Speech and the model list.
- Anthropic: Messages, for Claude Code and the Anthropic SDKs. The gateway converts these requests for every text model on sale.
Base URL
Base URL: https://api.azrouter.dev/v1
Use it for the OpenAI SDKs and any tool with an "OpenAI-compatible" or "OpenAI base URL" setting. The client adds /chat/completions, /responses, /embeddings and so on.
export OPENAI_BASE_URL="https://api.azrouter.dev/v1"
export OPENAI_API_KEY="$AZROUTER_API_KEY"Endpoints
| Method | Path | Format | Use it for | Models on sale today |
|---|---|---|---|---|
POST | /v1/chat/completions | OpenAI Chat Completions | Chat, tool calls, JSON output, streaming | Every text model |
POST | /v1/responses | OpenAI Responses | Codex CLI and other Responses clients | Every text model |
POST | /v1/messages | Anthropic Messages | Claude Code and the Anthropic SDKs | Every text model, converted by the gateway |
GET | /v1/models | OpenAI list | The model slugs your key can call | All |
POST | /v1/embeddings | OpenAI Embeddings | Vectors for search and RAG | openai/ |
POST | /v1/audio/speech | OpenAI Speech | Text to speech (MP3 bytes) | elevenlabs/ |
POST | /v1/messages/count_tokens | Anthropic | Not available: returns 404 | — |
Paths are shown in full. With an OpenAI base URL (https://api.azrouter.dev/v1) your client adds everything after /v1; with the Anthropic base URL (https://api.azrouter.dev) it adds /v1/messages.
Before you start
- Credits are prepaid. New accounts start on the Free tier, whose monthly cap is $0, so add credits before your first call. Cleared top-ups of $5 or more qualify you for T1. See Rate limits.
- Keys stay on your server. Never ship a key in a browser or mobile app. See Authentication.
- Content may be used for training. See Data use before you send anything sensitive.
FAQ
- Do I need a new SDK?
No.
Keep the OpenAI or Anthropic SDK you already use: change the base URL and the key.
See Quickstart.
- How is a request billed?
Units used × the model's listed price per unit, debited from prepaid credits.
Each request's total is rounded to the nearest $0.000002, halves up.
See Billing and rounding.
- What happens when my credits run out?
Calls return 402 with the code
insufficient_user_quotauntil you top up.See Errors.
- Are the prices the same as the makers' own?
Not always.
Markups are per model, so some models cost less than their market price and some cost more.
Every price on the models page sits next to its market price, with the difference; the market price is labelled as the maker's official price where we have checked it.
- What if I hit a rate limit?
You get 429 with a
Retry-Afterheader in seconds, and the OpenAI SDKs retry it for you.See Rate limits.
- Is my content used to train models?
It may be.
Content you send may be stored and used to train AI models by AZRouter, the upstream provider and the model's owner.
See Data use.
Next steps
Make your first AZRouter request in curl, Python or TypeScript.
Install the azrouter command line, log in with your key, then chat, make images and videos, list prices and check your balance from a terminal.
Run Claude Code on AZRouter with your AZRouter key, on any paid usage tier.
Run OpenAI's Codex CLI on AZRouter models through the Responses endpoint.
Use AZRouter models in Cursor through the OpenAI base URL override.
Use AZRouter in Cline through its OpenAI Compatible provider.
Call AZRouter from the official openai Python package.
Call AZRouter from the official openai npm package.
Use AZRouter as an OpenAI-compatible provider in the AI SDK.
Use AZRouter with LangChain's ChatOpenAI.