IN ENGLISH · API DOCS

Video generation: models, prices, requests and errors

gemini-omni-1.1-flash (Google's Gemini Omni Flash) makes a 4, 6 or 8-second clip at 720p in one synchronous call to /gemini/v1beta/interactions and is billed per second of video. muse-video and muse-video-20s (Meta's Muse models) are asynchronous tasks on /v1/video/generations: you create a task, poll it and download the file; each call has a fixed price, whatever the clip's length. A video that is not made costs nothing, and a task that fails is refunded.

Last updated:

[01]VIDEO GENERATION

The video models

The API's video models
ModelVendorRouteBilledLength and quality
gemini-omni-1.1-flashVendor:Google (Gemini Omni Flash)Route:POST /gemini/v1beta/interactionsBilled:Per second of videoLength and quality:4s, 6s or 8s; 720p; 16:9 or 9:16; always with sound
muse-videoVendor:Meta (Muse)Route:POST /v1/video/generationsBilled:A fixed price per call, today about 54,615 TomanLength and quality:What the model makes; duration does not change the price
muse-video-20sVendor:Meta (Muse)Route:POST /v1/video/generationsBilled:A fixed price per call, today about 61,442 TomanLength and quality:What the model makes; duration does not change the price
  • Each model answers on its own route only: gemini-omni-1.1-flash on /v1/video/generations answers 503 with code upstream_unavailable, and a Muse model on /gemini/v1beta/interactions answers 402 with code path_unmetered.
  • GET /v1/models lists gemini-omni-1.1-flash with type video. The Muse models are not in that list; this page is where they are named.
  • Without code: the video studio (in Persian) makes clips with the same gemini-omni-1.1-flash in the browser, from a first frame, a last frame or reference images, also billed per second.
[02]VIDEO GENERATION

Price and who pays

Gemini Omni (gemini-omni-1.1-flash)

  • The cost is the seconds you ask for in duration, at one rate per second; input images add nothing.
  • Today one second costs about 35,237 Toman: a 4-second clip about 140,948 Toman, a 6-second clip about 211,422 Toman and a 8-second clip about 281,896 Toman. The price follows each day's dollar rate. It carries the model's usual markup; the volume rule can lower it.
  • The full price of the clip is held before the call and charged only when the answer holds a video.
  • With a paid chat plan that includes the model, the plan's credit pays first, within its API share, and the wallet pays the rest (plans and gift credit). Gift credit does not pay for video.

The Muse models

  • Each call has one fixed price, whatever duration you send. It is held when you create the task and charged once the model accepts it.
  • It is paid from the wallet only; plan credit and gift credit do not pay for it.
  • These models are not on a public price list yet. The amount of each call is in its row of the usage report (cost_toman) and in the account API.

In the usage report, total_tokens of an Omni row is the seconds of video, and of a Muse row 1: one call. See reading your bill.

[03]VIDEO GENERATION

Gemini Omni: one synchronous call

POST /gemini/v1beta/interactions · A video from textcurl
curl https://1xai.ir/gemini/v1beta/interactions \
  -H "x-goog-api-key: 1xai-..." \
  -H "Content-Type: application/json" \
  --max-time 600 \
  -d '{
    "model": "gemini-omni-1.1-flash",
    "input": "Calm sea waves at sunset, with the sound of the waves",
    "response_format": {"type": "video", "duration": "8s", "aspect_ratio": "16:9", "resolution": "720p"}
  }'
A video from a photo, used as the first framejson
{
  "model": "gemini-omni-1.1-flash",
  "response_format": {"type": "video", "duration": "4s", "aspect_ratio": "9:16", "resolution": "720p"},
  "generation_config": {"video_config": {"task": "image_to_video"}},
  "input": [
    {"type": "image", "data": "<base64>", "mime_type": "image/png"},
    {"type": "text", "text": "The camera moves slowly in and the hair moves in the breeze"}
  ]
}
  • response_format is one object with type video. duration is required and is one of 4s, 6s or 8s. resolution is 720p only; any other value answers 402 with code model_not_priced. Set aspect_ratio to 16:9 or 9:16.
  • input is a text, or a list of text and image parts with the picture inline as base64 in data, with its mime_type. generation_config.video_config.task may be text_to_video, image_to_video or reference_to_video.
  • These are not accepted and answer 400 with code invalid_request, at no cost: background, "store": true and "delivery": "uri" (the video is stored nowhere), an image by uri, a video or audio input, previous_interaction_id, tools, stream, and any other task.
  • The answer arrives when the video is made: status is completed, and a model_output step holds a video part with the clip as base64 in its data. Only such an answer is billed. When Omni makes no video (it then says why in a text part, or the status is another one), nothing is charged.
  • The gateway waits up to 10 minutes for Google; give your client at least that long. If you close the connection before the answer arrives, the video that was made is billed and can no longer be fetched.
The answer, shortenedjson
{
  "id": "...",
  "status": "completed",
  "steps": [
    {
      "type": "model_output",
      "content": [{"type": "video", "data": "AAAAIGZ0eXBpc29t..."}]
    }
  ]
}

Send the key as on the rest of the native Gemini route, in the x-goog-api-key or Authorization: Bearer header (native Gemini route).

[04]VIDEO GENERATION

The Muse models: create, poll, download

POST /v1/video/generations · Create the taskcurl
curl https://1xai.ir/v1/video/generations \
  -H "Authorization: Bearer 1xai-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "muse-video",
    "prompt": "A paper boat on a stream in a park"
  }'

# {"task_id": "vt_...", "id": "vt_...", "model": "muse-video", "status": "queued"}
GET /v1/video/generations/{id} · Poll until `status_normalized` is no longer `pending`curl
curl https://1xai.ir/v1/video/generations/vt_... \
  -H "Authorization: Bearer 1xai-..."

# {"id": "vt_...", "task_id": "vt_...", "model": "muse-video", "status_normalized": "succeeded", ...}
GET /v1/video/generations/{id}/content · Download the videocurl
curl -o clip.mp4 https://1xai.ir/v1/video/generations/vt_.../content \
  -H "Authorization: Bearer 1xai-..."
  • The body is JSON with model and prompt; other fields reach the model as you send them, except a callback address (callback_url, notify_hook), which is removed: poll instead. duration (or seconds), when sent, must be a whole number such as 10 or "10s"; anything else answers 400 with code invalid_request.
  • The task id is 1xAi's own: vt_ and 24 characters. Only the account that created the task reaches it, and with a company key only that workspace; any other key gets 404 with code not_found.
  • In a poll's answer, read status_normalized: pending, succeeded or failed. The rest of the answer is the model's own and may change; any file address in it points to this task's /content route.
  • Once status_normalized is succeeded, GET …/{id}/content streams the video file with the same key; before that it answers 404 with code not_found. 1xAi keeps no copy of the file, so save it on your side.
  • Only creating a task is billed. Polling and downloading are free and count toward the key's rate limit.
  • A task the model reports failed is refunded once, at your next poll or by a check that runs every 5 minutes. A task still pending after 24 hours is taken as failed and refunded. A refund is a wallet transaction and a usage row with endpoint refund.
  • A request the model refuses (for example under its content rules) costs nothing, and the model's error is passed back to you.
[05]VIDEO GENERATION

Errors

Errors of the video routes
StatusCodeWhen
400Code:invalid_requestWhen:The body is not valid JSON; on Omni, duration is missing or another value, or an option listed above was sent; on Muse, duration is not a whole number.
402Code:insufficient_balanceWhen:The balance cannot fund the hold of the video's price.
402Code:plan_media_usedWhen:On Omni: the paid plan's media share for this period is used up, and the wallet cannot fund the call.
402Code:model_not_pricedWhen:On Omni: resolution is not 720p.
402Code:path_unmeteredWhen:On /gemini/v1beta/interactions, a model that has no video price (a text model, an agent, or a Muse model).
404Code:not_foundWhen:A task id this key cannot reach, or a video that is not ready yet.
410Code:model_retiredWhen:A retired video model (Veo on Gemini, Sora on /v1/videos).
502Code:upstream_errorWhen:The model could not be reached, or its answer could not be read. Nothing is charged.
503Code:upstream_unavailableWhen:A model that /v1/video/generations does not serve, or whose route is switched off for now.

The error body and every code are on Errors. None of these errors is billed.

[06]VIDEO GENERATION

Other video routes

  • Google has retired the Veo models on its API; :predictLongRunning with one of them answers 410 with code model_retired.
  • OpenAI has retired the Sora models; creating a video on /v1/videos with one of them answers 410 with code model_retired (OpenAI-compatible endpoints).
  • The full list of retired ids is on Deprecations.

1xAi is an independent gateway. It is not affiliated with, endorsed by, or a reseller for OpenAI, Anthropic, Google, DeepSeek, xAI, Moonshot AI, Z.ai, Alibaba Qwen, MiniMax or Tencent Hunyuan. Requests are relayed upstream rather than answered by models of our own, so each provider's own usage policies apply to what their models will and will not do, and their model availability is theirs to change. Current reachability is published on the status page.