Skip to content

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.

Get API keyQuickstart
How a request reaches a model
Path of a request01Your code
An OpenAI or Anthropic SDK, or curl
02base_url
api.azrouter.dev
03AZRouter
Checks the key, prices each unit
04Provider
Runs the model
05Response
OpenAI or Anthropic JSON or SSE, with usage
  1. Your code. An OpenAI or Anthropic SDK, or curl
  2. base_url. api.azrouter.dev
  3. AZRouter. Checks the key, prices each unit
  4. Provider. Runs the model
  5. 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/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.

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.

Shell
export OPENAI_BASE_URL="https://api.azrouter.dev/v1"
export OPENAI_API_KEY="$AZROUTER_API_KEY"

Endpoints

MethodPathFormatUse it forModels on sale today
POST/v1/chat/completionsOpenAI Chat CompletionsChat, tool calls, JSON output, streamingEvery text model
POST/v1/responsesOpenAI ResponsesCodex CLI and other Responses clientsEvery text model
POST/v1/messagesAnthropic MessagesClaude Code and the Anthropic SDKsEvery text model, converted by the gateway
GET/v1/modelsOpenAI listThe model slugs your key can callAll
POST/v1/embeddingsOpenAI EmbeddingsVectors for search and RAGopenai/text-embedding-3-large
POST/v1/audio/speechOpenAI SpeechText to speech (MP3 bytes)elevenlabs/eleven-v3
POST/v1/messages/count_tokensAnthropicNot 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_quota until 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-After header 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.