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.
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/qwen3.8-flash.
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.
- 01
Your code
An OpenAI or Anthropic SDK, or curl - 02
base_url
api.azrouter.dev - 03
AZRouter
Checks the key, prices each unit - 04
Provider
Anthropic, OpenAI, Google, SpaceXAI, Qwen - 05
Response
OpenAI or Anthropic JSON or SSE, with usage
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/text-embedding-3-large |
POST | /v1/audio/speech | OpenAI Speech | Text to speech (MP3 bytes) | elevenlabs/eleven-v3 |
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 OpenRouter's?
Not always. Markups are per model, so some models cost less than OpenRouter and some cost more. Every price on the models page sits next to OpenRouter's, with the difference.
- 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
- Quickstart: your first request in curl, Python or TypeScript.
- Tool guides: Claude Code, Codex CLI, Cursor, Cline.
- SDK guides: OpenAI SDK for Python, OpenAI SDK for TypeScript, Vercel AI SDK, LangChain.