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/, for example qwen/.
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
| Parameter | Details |
|---|---|
Authorizationstringheaderrequired | Your API key as |
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/:
- 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_tokensor 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/generationswithmodelandprompt. Usen: 1andresponse_format: "b64_json"only. The response contains one whole PNG or baseline JPEG (a WebP file on Ideogram 3.0) as base64 indata[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 othernis refused with400before anything is billed. Both images come back whole, indata[0].b64_jsonanddata[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
400before anything is billed. -
Reference images (Nano Banana 2).
google/also takesgemini-3.1-flash-image 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. Sendsize: "1024x1024"for 1K orsize: "2048x2048"for 2K (the default). 4K is temporarily unavailable. For example: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/and the other ten named here also takegrok-imagine-image-2.0 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 namedimage/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 refusepng imageswith400. 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 withimagesis refused with400and nothing is billed. For example: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/removes an image's background and returns a PNG of the same size, the background transparent.remove-background recraft/upscales an image to twice its width and height and returns a PNG. Sendcrisp-upscale 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.promptis required but not used, and the result keeps the shape of your image. -
Sizes and quality (GPT Image 2). GPT Image 2 also takes
sizeandquality, at the same price per image.sizeis1024x1024orautofor a square image of 1254 × 1254 pixels,1024x1536for a portrait image of 1024 × 1536 pixels, or1536x1024for a landscape image of 1536 × 1024 pixels; left out, the image is square.qualityisauto,mediumorhigh; it is accepted and does not change the image. Other sizes andquality: "low"are refused with400before anything is billed. With the CLI:--size 1024x1536 -p quality=high. -
No streaming or image URLs. Omit
streamor set it tofalse. Streaming, URL responses andoutput_formatare refused with400, 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:
| Model | Length | Size | Sound |
|---|---|---|---|
| Veo 3.1 Lite, Veo 3.1 Fast | 8 s | 720p | Yes |
| Gemini Omni Flash, Gemini Omni 1.2 Flash | 4 s | 720p | Yes |
Gemini Omni 1.2 Flash, a model a size (-360p, -1080p, -4k) | 4 s | 360p; 1080p and 4K, Google's 720p upsampled | Yes |
| Seedance 1.0 Pro | 5 s | 480p | No |
| Kling v2.5 Turbo Pro | 5 s | 1080p | Yes |
| Kling v2.6 | 5 s | 1080p | No |
| Kling v3.0 Pro | 3 s | 1080p | No |
| Kling v3.0 Turbo, Kling v3.0 Omni | 3 s | 720p | Yes |
| Wan 2.5, Wan 2.6, Wan 2.7 | 5 s | 720p | Yes |
| Wan 3.0 (from a text prompt) | 4 s | 720p | Yes |
| HappyHorse 1.1 | 3 s | 720p | Yes |
| Grok Imagine Video, Grok Imagine Video 1.5 | 6 s | 752x416 | Yes |
| Gen-4 Turbo | 5 s | 720p | No |
| PixVerse V6, PixVerse V6 Max | 5 s | 360p | No |
| Hailuo 02 | 6 s | 768p | No |
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):
| Model | Length | Size | Sound |
|---|---|---|---|
| Seedance 1.0 Pro Fast | 5 s | 1248x704 | No |
| Hailuo 2.3 | 6 s | 1364x768 | No |
| Vidu Q4 | 5 s | 540p | No |
| Wan 2.6 Flash | 5 s | 720p | No |
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:
| Model | Images | Makes |
|---|---|---|
| PixVerse V6 | 2 | A video from its first and last frames, each exactly 16:9 |
| PixVerse V6 | 3 to 7 | A video from reference images |
| Wan 2.7 | 2 to 5 | A video from reference images |
| Vidu Q4 | 2 to 15 | A video from reference images, at 960x528 |
These work from an input video, sent by URL:
| Model | Also needs | Length | Makes |
|---|---|---|---|
| Kling v2.6 Motion Control | One input image | 5 s | The 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 Control | One input image | 5 s | The same |
| Wan 2.2 Animate Move | One input image | 5 s | The same |
| Wan 2.7 | Nothing | 5 s | The video, edited as the prompt asks, at 720p |
- One video per request, as a task. Send
POST /v1/videoswith a JSON body ofmodel,promptandseconds, 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 anid. CheckGET /v1/videos/{id}until itsstatusiscompleted(orfailed); a video takes a few minutes. Then download the MP4 fromGET /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 with400and the codevideo_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 codevideo_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,@ref2and so on, each with a space after it; any other@word is refused. A request outside these numbers is refused with400and the codevideo_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 inimages, 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 apromptbut does not use it. Wan 2.7 takes a video or images, not both. A request without what the model needs is refused with400and the codevideo_input_request; a video that can't be read, or is the wrong format or length, withinput_video_unreadable,input_video_invalidorinput_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.createsends one), any other field and any other endpoint are billed at the model's second price. A model without one refuses them with400and the codevideo_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/videoswith a JSON body ofmodelandprompt, and optionallyseconds,imagesandmetadata(below). The answer is a task with anid. CheckGET /v1/videos/{id}until itsstatusiscompleted(orfailed); a video takes a few minutes. Then download the MP4 fromGET /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 (5or"5"). 5 when left out.images: a first frame to start the video from, as a list of one image: anhttps://URL (up to 4,096 characters) or a base64data:URL of a PNG, JPEG or WebP image of up to 18 MB.metadata: an object with onlyresolution(480p,720p, or1080pwhere the model's page lists it;720pwhen left out),ratio(21:9,16:9,4:3,1:1,3:4,9:16, oradaptivefor the first frame's shape; left out,16:9from a prompt alone and the first frame's with an image) andgenerate_audio(trueorfalse;truewhen 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 assizeorinput_reference), more than one image, a resolution the model doesn't make, a form body instead of JSON, and any other endpoint are refused with400and the codevideo_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:
| Ratio | 480p | 720p | 1080p |
|---|---|---|---|
| 21:9 | 992 × 432 | 1,470 × 630 | 2,206 × 946 |
| 16:9 | 864 × 496 | 1,280 × 720 | 1,920 × 1,080 |
| 4:3 | 752 × 560 | 1,112 × 834 | 1,664 × 1,248 |
| 1:1 | 640 × 640 | 960 × 960 | 1,440 × 1,440 |
| 3:4 | 560 × 752 | 834 × 1,112 | 1,248 × 1,664 |
| 9:16 | 496 × 864 | 720 × 1,280 | 1,080 × 1,920 |
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/embeddingswithmodelandinput: one string, or a list of 1 to 128 strings, none of them empty. You may also senddimensions(from 1 to the model's own size),encoding_format(floatorbase64) anduser. 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
400and the codeembedding_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/speechwithmodel,input(the text, up to the model's character limit) andvoice, an ElevenLabs voice ID such as21m00Tcm4TlvDq8ikWAM(not a voice name such asalloy). You may also sendresponse_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
400and the codespeech_request(speech_request_too_longfor 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
| Modality | Route |
|---|---|
| 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
| Parameter | Details |
|---|---|
modelstringrequired | An embedding model's slug, for example |
inputstringrequired | 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
| Parameter | Details |
|---|---|
modelstringrequired | A speech model's slug, for example |
inputstringrequired | The text to speak. |
voicestringrequired | An ElevenLabs voice ID. OpenAI voice names such as |
response_formatstring | Ask for 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":
{
"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:
{"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.