Skip to content
AZRouter.dev

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.
  1. 01

    Your code

    An OpenAI or Anthropic SDK, or curl
  2. 02

    base_url

    api.azrouter.dev
  3. 03

    AZRouter

    Checks the key, prices each unit
  4. 04

    Provider

    Anthropic, OpenAI, Google, SpaceXAI, Qwen
  5. 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.

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 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-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