Skip to content

Get started

Models

Address a model by its slug and list the models your key can call.

A model is addressed by its slug, provider/model, for example qwen/qwen3.8-flash.

Only models on sale can be called.

Prices, context length and modalities are on each model's page in the catalog.

List models

GET /v1/models returns the slugs your key can call, in OpenAI's list format.

GET/v1/models

Fields
ParameterDetails
Authorization
stringheaderrequired

Your API key as Bearer <key>.

Each entry also carries owned_by and supported_endpoint_types; don't rely on them to pick a route.

Use the endpoint table instead.

Lower-priced requests

Some models have a lower price, served through third-party providers. Such a model has one price for every request: chat, tools, media and coding agents such as Claude Code or Codex alike. The catalog and the model's page show it. You always send the model's own id, for example google/gemini-3.8-flash:

  • Text and tools. Such a model takes text, with or without tools. A request with an image, audio or a file is refused with 400.
  • No cache discount. The lower price has no cache price: cached input tokens are billed at its input price.
  • The lower price follows the providers. It is set from what the third-party providers charge, so it can change at any time (Terms, section 4.5); it is never above the maker's official price (the market price where we have none). The model's page always shows the current price.
  • Availability can change. When no third-party provider can serve the model, it is unavailable until a provider can serve it again.
  • An explicit output limit caps your output charges. If you set max_tokens or the equivalent for your endpoint, that limit and the model maximum bound the output tokens we bill. Input charges still apply. A provider can keep generating after you disconnect, so stopping a stream early may still incur charges up to the applicable output limit.
  • Your data. The third-party providers and the sellers behind them process your prompts and outputs under their own terms (Terms, section 5.3). For confidential work, use a model whose page shows no lower price.

Lower-priced images

Some image models are sold at a lower price per image, for one kind of request. Third-party providers make the images, and the model's page says what it makes:

  • One image per request. Send POST /v1/images/generations with model and prompt. Use n: 1 and response_format: "b64_json" only. The response contains one whole PNG or baseline JPEG (a WebP file on Ideogram 3.0) as base64 in data[0].b64_json. The lower-priced image is square (1:1), at the size the model's page shows: 1K or 2K on Nano Banana 2, 2K on Seedream 5.0 Lite, Seedream 4.5 and Qwen Image 3 Pro, and 1K on the others (1408 × 1408 pixels on Grok Imagine Image 2.0, or 1024 × 1024 at the same price when its backup provider makes it; 1254 × 1254 on GPT Image 1.5). GPT Image 2 also makes portrait and landscape images (below).

  • Two images per request (Grok Imagine Image). Grok Imagine Image makes two 960 × 960 JPEG images per request and is priced per image, so a request costs two images. Send n: 2; any other n is refused with 400 before anything is billed. Both images come back whole, in data[0].b64_json and data[1].b64_json.

  • Prompt length. Some models take a prompt of a set length, counted in characters: Seedream 5.0 Pro and Seedream 5.0 Flash 4 to 5,000, Seedream 5.0 Lite 4 to 2,995, Seedream 4.5 up to 3,000, Seedream 4.0, FLUX 3 Image Klein, FLUX.1 Kontext [pro], FLUX.1 Kontext [max], Ideogram 3.0, Qwen Image 3 Pro, Wan 2.7 Image and Wan 2.7 Image Pro up to 5,000, FLUX.2 [pro] 3 to 5,000, Z-Image Turbo up to 1,000, Grok Imagine Image up to 5,000, Grok Imagine Image 2.0 up to 8,000, and Nano Banana, Nano Banana Pro, Nano Banana 2 Lite, Nano Banana 2.1, GPT Image 2 and GPT Image 1.5 up to 20,000. A prompt outside it is refused with 400 before anything is billed.

  • Reference images (Nano Banana 2). google/gemini-3.1-flash-image also takes images: a list of up to 10 reference images, in order, each a base64 PNG, JPEG or WebP data URL whose type is the file's, at most 10 MB and at least 256 pixels a side, about 6 MB in all (the request must stay under 8 MiB). They are included in the per-image price. Send size: "1024x1024" for 1K or size: "2048x2048" for 2K (the default). 4K is temporarily unavailable. For example:

    Shell
    curl https://api.azrouter.dev/v1/images/generations \
      -H "Authorization: Bearer $AZROUTER_API_KEY" -H "Content-Type: application/json" \
      -d '{"model": "google/gemini-3.1-flash-image", "prompt": "The same red cube on a forest floor", "images": ["data:image/png;base64,iVBORw0KGgo…"]}'

    With the CLI: azrouter image "The same red cube on a forest floor" -m google/gemini-3.1-flash-image -i cube.png.

  • A reference image (Grok Imagine Image 2.0, Seedream 5.0 Pro, Seedream 5.0 Lite, Seedream 5.0 Flash, Seedream 4.5, Seedream 4.0, FLUX 3 Image Klein, FLUX.1 Kontext [pro], FLUX.1 Kontext [max], Ideogram 3.0 and GPT Image 1.5). x-ai/grok-imagine-image-2.0 and the other ten named here also take images: a list of one reference image of exactly 1:1, a base64 PNG, JPEG or WebP data URL whose type is the file's (data:image/png;base64,… for a PNG; a JPEG named image/png is refused), at most 10 MB and at least 256 pixels a side. It is included in the per-image price, and the image keeps the model's one size (FLUX.1 Kontext's and Ideogram 3.0's image from a reference image is 992 × 992). Image URLs are not fetched; image models other than Nano Banana 2, these and Recraft's tools below refuse images with 400. Grok Imagine Image 2.0's backup provider takes no reference image: when it serves the request (while the main provider is unavailable, or on a retry after the main provider fails), a request with images is refused with 400 and nothing is billed. For example:

    Shell
    curl https://api.azrouter.dev/v1/images/generations \
      -H "Authorization: Bearer $AZROUTER_API_KEY" -H "Content-Type: application/json" \
      -d '{"model": "x-ai/grok-imagine-image-2.0", "prompt": "The same red cube on a forest floor", "images": ["data:image/png;base64,iVBORw0KGgo…"]}'

    With the CLI: azrouter image "The same red cube on a forest floor" -m x-ai/grok-imagine-image-2.0 -i cube.png.

  • Recraft's image tools. recraft/remove-background removes an image's background and returns a PNG of the same size, the background transparent. recraft/crisp-upscale upscales an image to twice its width and height and returns a PNG. Send images: a list of one base64 PNG, JPEG or WebP data URL whose type is the file's, at most 5 MB and 4,096 pixels a side, at most 9 megapixels (3 on Crisp Upscale), its long side at most 3 times its short side. prompt is required but not used, and the result keeps the shape of your image.

  • Sizes and quality (GPT Image 2). GPT Image 2 also takes size and quality, at the same price per image. size is 1024x1024 or auto for a square image of 1254 × 1254 pixels, 1024x1536 for a portrait image of 1024 × 1536 pixels, or 1536x1024 for a landscape image of 1536 × 1024 pixels; left out, the image is square. quality is auto, medium or high; it is accepted and does not change the image. Other sizes and quality: "low" are refused with 400 before anything is billed. With the CLI: --size 1024x1536 -p quality=high.

  • No streaming or image URLs. Omit stream or set it to false. Streaming, URL responses and output_format are refused with 400, even when the model has a second price. That price covers supported image requests on other endpoints, not these refused options.

  • Billed per image. A request that returns its image costs the price per image on the model's page, however long the prompt. Tokens are not billed.

  • Like other lower prices. The price follows the providers and can change at any time, its availability can change, and the providers process your prompts and images under their own terms.

Lower-priced videos

Some video models are sold at a lower price per second, for one kind of video. Third-party providers make the videos, and the model's page says which video it makes. GET /v1/models lists the models on sale; each makes one video:

ModelLengthSizeSound
Veo 3.1 Lite, Veo 3.1 Fast8 s720pYes
Gemini Omni Flash, Gemini Omni 1.2 Flash4 s720pYes
Gemini Omni 1.2 Flash, a model a size (-360p, -1080p, -4k)4 s360p; 1080p and 4K, Google's 720p upsampledYes
Seedance 1.0 Pro5 s480pNo
Kling v2.5 Turbo Pro5 s1080pYes
Kling v2.65 s1080pNo
Kling v3.0 Pro3 s1080pNo
Kling v3.0 Turbo, Kling v3.0 Omni3 s720pYes
Wan 2.5, Wan 2.6, Wan 2.75 s720pYes
Wan 3.0 (from a text prompt)4 s720pYes
HappyHorse 1.13 s720pYes
Grok Imagine Video, Grok Imagine Video 1.56 s752x416Yes
Gen-4 Turbo5 s720pNo
PixVerse V6, PixVerse V6 Max5 s360pNo
Hailuo 026 s768pNo

These make each video from one input image and a text prompt (the video follows the image's frame, so the image must be exactly 16:9):

ModelLengthSizeSound
Seedance 1.0 Pro Fast5 s1248x704No
Hailuo 2.36 s1364x768No
Vidu Q45 s540pNo
Wan 2.6 Flash5 s720pNo

Grok Imagine Video (not 1.5), Wan 2.5, Wan 2.6, Wan 2.7, Kling v2.6, Kling v2.5 Turbo Pro, Kling v3.0 Turbo, Kling v3.0 Omni, HappyHorse 1.1, Seedance 1.0 Pro, PixVerse V6 and PixVerse V6 Max also take one input image if you send one: the same video at the same price, which then follows the image's frame, so the image must be exactly 16:9.

Three of them take more images, at the same price:

ModelImagesMakes
PixVerse V62A video from its first and last frames, each exactly 16:9
PixVerse V63 to 7A video from reference images
Wan 2.72 to 5A video from reference images
Vidu Q42 to 15A video from reference images, at 960x528

These work from an input video, sent by URL:

ModelAlso needsLengthMakes
Kling v2.6 Motion ControlOne input image5 sThe person in the image moves as the person in the video does, at 720p in the image's shape, no sound
Kling v3.0 Motion ControlOne input image5 sThe same
Wan 2.2 Animate MoveOne input image5 sThe same
Wan 2.7Nothing5 sThe video, edited as the prompt asks, at 720p
  • One video per request, as a task. Send POST /v1/videos with a JSON body of model, prompt and seconds, set to the video's length as a string ("8" for Veo 3.1 Lite, "4" for Gemini Omni Flash). The answer is a task with an id. Check GET /v1/videos/{id} until its status is completed (or failed); a video takes a few minutes. Then download the MP4 from GET /v1/videos/{id}/content. It is kept for a day after it is made.
  • One input image, where the model takes one. The models made from an input image need exactly one, in images: a list of one https URL or one PNG, JPEG or WebP base64 data URL, of exactly 16:9 (such as 1280x720 or 1920x1080), at least 256 pixels a side and at most 10 MB. An https URL is read once, as it answers, without following a redirect. A request without one, or with more than one, is refused with 400 and the code video_image_request; an image of another shape or size is refused before anything is billed. On Grok Imagine Video, Wan 2.5, Wan 2.6, Kling v2.6, Kling v2.5 Turbo Pro and Seedance 1.0 Pro the image is optional, with the same limits; a request with more than one is refused with the code video_image_optional_request.
  • More than one image, where the model takes more. Send them in images, in order: the number of images picks what the video is made from, as in the table above. Each is an https URL or a PNG, JPEG or WebP base64 data URL, at least 256 pixels a side and at most 10 MB. A first and last frame must each be exactly 16:9; a reference image may be any shape, and the video stays 16:9. On PixVerse V6 the prompt can name its reference images @ref1, @ref2 and so on, each with a space after it; any other @ word is refused. A request outside these numbers is refused with 400 and the code video_images_request.
  • One input video, where the model takes one. Send video: the https URL of an MP4 file (H.264 or H.265, not fragmented) of at most 32 MB, 256 to 4,096 pixels a side, longer than 4 and at most 5 seconds. It is read once, as it answers, without following a redirect. Kling's motion control models and Wan 2.2 Animate Move also need one input image in images, of any shape, with the person to move; Kling needs at least 340 pixels a side and Wan 2.2 Animate Move at most 5 MB. Wan 2.2 Animate Move needs a prompt but does not use it. Wan 2.7 takes a video or images, not both. A request without what the model needs is refused with 400 and the code video_input_request; a video that can't be read, or is the wrong format or length, with input_video_unreadable, input_video_invalid or input_video_length, before anything is billed.
  • One size and length. Every video is landscape, at the size and length in the table, which the model's page also shows: 16:9 at the listed resolution, 752x416 for Grok Imagine Video, 1248x704 for Seedance 1.0 Pro Fast and 1364x768 for Hailuo 2.3. A video made from an input video and an image has the image's shape instead. Models without sound make a silent video. Only the API key that made a video can check or download it; any other key gets 404.
  • Other video requests. Input images (on the models that make a video from a prompt alone), other sizes or lengths, remixes, a form body instead of JSON (the OpenAI SDK's videos.create sends one), any other field and any other endpoint are billed at the model's second price. A model without one refuses them with 400 and the code video_request; the message lists what is accepted.
  • Billed per second, for the whole video. A request costs its length times the price per second on the model's page, however long the prompt, and is charged when the task is made. If the video fails, including one that fails our checks (a video of another size or length, or on Google's models a video Google did not sign as its model made it, such as one resized afterwards), the charge is refunded in full.
  • Like other lower prices. The price follows the providers and can change at any time, its availability can change, and the providers process your prompts and videos under their own terms.

Videos billed per token

Seedance 2.0 and Seedance 2.0 mini, ByteDance's video models, are billed per video token, the unit ByteDance prices them in, at a price for each resolution. Third-party providers make the videos, and the model's page shows each resolution's price next to ByteDance's official price:

  • One video per request, as a task. Send POST /v1/videos with a JSON body of model and prompt, and optionally seconds, images and metadata (below). The answer is a task with an id. Check GET /v1/videos/{id} until its status is completed (or failed); a video takes a few minutes. Then download the MP4 from GET /v1/videos/{id}/content. It is kept for a day after it is made, and only the API key that made it can check or download it.
  • seconds: the video's length, a whole number from 4 to 15, as a number or a string (5 or "5"). 5 when left out.
  • images: a first frame to start the video from, as a list of one image: an https:// URL (up to 4,096 characters) or a base64 data: URL of a PNG, JPEG or WebP image of up to 18 MB.
  • metadata: an object with only resolution (480p, 720p, or 1080p where the model's page lists it; 720p when left out), ratio (21:9, 16:9, 4:3, 1:1, 3:4, 9:16, or adaptive for the first frame's shape; left out, 16:9 from a prompt alone and the first frame's with an image) and generate_audio (true or false; true when left out).
  • Billed by the video's tokens. A video's tokens are its width × height × frames ÷ 1,024, rounded down, with 24 frames a second plus the first frame, so a 5-second 720p video at 16:9 is 1,280 × 720 × 121 ÷ 1,024 = 108,900 tokens. It costs its tokens times its resolution's price per million. An estimate is held when the task is made and settled to the video's exact tokens when it is done. If the video fails, including one that fails our checks, the charge is refunded in full.
  • Other requests. Any other field, at the top level or in metadata (such as size or input_reference), more than one image, a resolution the model doesn't make, a form body instead of JSON, and any other endpoint are refused with 400 and the code video_token_request; the message lists what is accepted.
  • Like other prices through providers. The price follows the providers and can change at any time; it is never above ByteDance's official price. Its availability can change, and the providers process your prompts, images and videos under their own terms.

Each ratio has its own frame size, so a second of video costs a little more or less at each one:

Ratio480p720p1080p
21:9992 × 4321,470 × 6302,206 × 946
16:9864 × 4961,280 × 7201,920 × 1,080
4:3752 × 5601,112 × 8341,664 × 1,248
1:1640 × 640960 × 9601,440 × 1,440
3:4560 × 752834 × 1,1121,248 × 1,664
9:16496 × 864720 × 1,2801,080 × 1,920
Shell
curl https://api.azrouter.dev/v1/videos \
  -H "Authorization: Bearer $AZROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "bytedance/seedance-2.0", "prompt": "a red fox runs through fresh snow", "seconds": 5,
       "metadata": {"resolution": "720p", "ratio": "16:9", "generate_audio": true}}'

Lower-priced embeddings

Some embedding models are sold at a lower price per token, for one kind of request. Third-party providers make the embeddings, and the model's page shows the price:

  • Up to 128 inputs per request. Send POST /v1/embeddings with model and input: one string, or a list of 1 to 128 strings, none of them empty. You may also send dimensions (from 1 to the model's own size), encoding_format (float or base64) and user. The answer has one embedding per input, in the size you asked for.
  • Other embedding requests. Token arrays as input, more than 128 inputs, any other field and any other endpoint are billed at the model's second price. A model without one refuses them with 400 and the code embedding_request; the message lists what is accepted.
  • Billed per input token. A request costs its input tokens times the price per million on the model's page. Nothing else is billed.
  • Like other lower prices. The price follows the providers and can change at any time, its availability can change, and the providers process your inputs under their own terms.

Lower-priced speech

Some speech models are sold at a lower price per character, for one kind of request. Third-party providers make the speech, and the model's page shows the price and how many characters a request may carry, for example 3,000:

  • One MP3 per request. Send POST /v1/audio/speech with model, input (the text, up to the model's character limit) and voice, an ElevenLabs voice ID such as 21m00Tcm4TlvDq8ikWAM (not a voice name such as alloy). You may also send response_format: "mp3". The answer is one whole MP3 file, sent once it is made: about a minute for 3,000 characters.
  • Other speech requests. Longer text, voice names, other formats, streaming, any other field and any other endpoint are billed at the model's second price. A model without one refuses them with 400 and the code speech_request (speech_request_too_long for longer text); the message lists what is accepted.
  • Billed per character. A request costs the characters of its input (each Unicode character counts once, spaces and punctuation included) times the price per million characters on the model's page. Nothing else is billed.
  • Like other lower prices. The price follows the providers and can change at any time, its availability can change, and the providers process your text and audio under their own terms.

Which route a model uses

ModalityRoute
Text/v1/chat/completions, /v1/responses or /v1/messages
Embedding/v1/embeddings
Speech (lower-priced speech too)/v1/audio/speech
Image (lower-priced images only)/v1/images/generations
Video (lower-priced videos and videos billed per token only)/v1/videos

Embeddings

POST/v1/embeddings

Fields
ParameterDetails
model
stringrequired

An embedding model's slug, for example openai/text-embedding-3-large.

input
stringrequired

The text to embed.

The response holds one vector per input in data[].embedding; this model returns 3,072 numbers.

Speech

POST/v1/audio/speech

Fields
ParameterDetails
model
stringrequired

A speech model's slug, for example elevenlabs/eleven-v4. Eleven v4 accepts up to 10,000 characters per request, and Eleven v3 up to 5,000. AZRouter caps Eleven v4 Turbo at 5,000 characters per request.

input
stringrequired

The text to speak.

voice
stringrequired

An ElevenLabs voice ID.

OpenAI voice names such as alloy are refused with 400 "Unknown voice".

response_format
string

Ask for "mp3".

Without it the bytes that come back are not an MP3 file.

The body is the audio file itself, not JSON.

Reasoning models

Some text models reason before they answer.

The reasoning is billed as output tokens and counted in usage.completion_tokens_details.reasoning_tokens.

If max_tokens runs out while the model is still reasoning, the reply has content: null and finish_reason: "length":

JSON
{
  "finish_reason": "length",
  "message": {"role": "assistant", "content": null, "reasoning": "We need to respond to user: \"Say hello in 3 words.\" Simple"},
  "usage": {"prompt_tokens": 68, "completion_tokens": 16, "completion_tokens_details": {"reasoning_tokens": 16}}
}

Raise max_tokens and send the request again.

Tools and coding agents

In Dashboard → API keys, turn on Cheaper routing for tools and coding agents for a key to let certified partner providers serve tool and coding-agent text. This setting is off by default. A partner that does not pass the tool checks uses standard routing instead. Media and stateful Responses keep their existing routing.

Midjourney jobs

Use model midjourney. Imagine costs $0.0495 per job, including all four images. A failed job costs nothing; any temporary charge is refunded in full. Midjourney has no official API or per-job tariff. These are AZRouter's standalone job prices. Basic costs $10 up front per month; imagine here costs less for fewer than about 202 jobs a month.

Submit an imagine job with POST /v1/midjourney/generations:

JSON
{"model":"midjourney","prompt":"a lighthouse --sref 1234567 --ar 16:9 --v 7 --raw"}

Prompt parameters, including --sref URLs and codes, --ar, --v and --raw, are passed through unchanged. The response contains a task_id. Read GET /v1/tasks/{task_id} until status is SUCCESS or FAILURE. Then read GET /v1/tasks/{task_id}/artifacts and download every image from its content_url. Imagine returns four images, each stored by AZRouter for 24 hours from submission. Keep the same API key for submission, status, artifacts and downloads.

Upscale is not available. A request with "action":"upscale" is refused with a 400 error, code action_unavailable, before a job is created, and costs nothing. Requests use JSON; streaming and other fields are refused before a job is created.