Get started
Quickstart
Make your first AZRouter request in curl, Python or TypeScript.
If your code already calls OpenAI or Anthropic, the switch is two values: the base URL and the key.
1. Add credits and create a key
New accounts start on the Free tier, whose monthly cap is $0. Add credits in Dashboard → Credits first, then create a key in Dashboard → API keys. The key is shown once; copy it and export it so the examples below can read it.
export AZROUTER_API_KEY="sk-..."2. Pick a 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"3. Send a request
The examples use qwen/qwen3.8-flash, a low-cost text model. Any slug from the model list works the same way.
curl https://api.azrouter.dev/v1/chat/completions \
-H "Authorization: Bearer $AZROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen3.8-flash",
"messages": [{"role": "user", "content": "Reply with exactly: Hello from AZRouter"}],
"max_tokens": 200
}'The reply text is in choices[0].message.content:
Hello from AZRouterLeave room for reasoning
Some models, qwen/qwen3.8-flash among them, think before they answer and bill those reasoning tokens as output. With a very small max_tokens the limit can run out during the thinking, and content comes back null with finish_reason: "length". Keep max_tokens at a few hundred for short answers.
Next steps
- Use a tool: Claude Code, Codex CLI, Cursor, Cline.
- Read the request and response fields: Chat Completions, Anthropic Messages, Streaming.
- Know what a call costs: Billing and rounding.