Browse docs ▾
API reference

Video generation

Make short videos with sound from a prompt, or bring an image to life. A video takes from about 15 seconds to a few minutes, so it runs in the background: you start it, check its status, and download the MP4 when it's ready.

Models

ModelLengthResolutionShapesImages
google/gemini-omni-1.1-flash3-10 s360p, 720p, 1080p, 4K16:9, 9:16up to 3; also edits and extends its own videos
xai/grok-imagine-video-1.51-15 s480p, 720p, 1080p16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3up to 3
xai/grok-imagine-video-1.5-lite1-15 s480p, 720p, 1080p16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:31
xai/grok-imagine-video1-15 s480p, 720p16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:31; also edits and extends

A value a model doesn't support is refused with a 400 that lists what it does.

Start a video

POST/v1/videos
bash
curl https://boldrouter.com/v1/videos \
  -H "Authorization: Bearer $BOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-omni-1.1-flash",
    "prompt": "A slow walk through a bright Scandinavian living room, single continuous shot, no dialogue",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "seconds": 6
  }'
FieldTypeDescription
model*stringA video model. See video models.
prompt*stringWhat to show and hear: scene, camera movement, lighting, sound. Up to 8,000 characters.
resolutionstring360p, 480p, 720p (default), 1080p or 4k, as the model supports. Omni's 1080p and 4K are upscaled.
aspect_ratiostring16:9 (default, landscape), 9:16 (portrait), or for Grok also 1:1, 4:3, 3:4, 3:2 and 2:3.
sizestringInstead of the two above, OpenAI-style: 1280x720, 720x1280, 848x480, 720x720 and so on.
secondsintegerWithin the model's range (above). Left out, Omni picks a length that suits the prompt and Grok makes 8 seconds.
imagesarrayImages as base64 data: URLs (PNG, JPEG or WebP; GIF for Omni). One image is brought to life as the first frame. With Omni, two can be the first and last frame, or references for a subject; with Grok 1.5, several are references. Say how to use them in the prompt. input_reference (one image) works too.

The response returns at once, with the video still generating:

json
{
  "id": "video_4bdf63d3fae6f69acd790312",
  "object": "video",
  "model": "google/gemini-omni-1.1-flash",
  "status": "in_progress",
  "created_at": 1793112000,
  "completed_at": null,
  "expires_at": null,
  "resolution": "720p",
  "aspect_ratio": "16:9",
  "size": "1280x720",
  "seconds": 6,
  "cost_usd": null,
  "content_url": null,
  "error": null
}

Check the status

GET/v1/videos/{id}

Poll every few seconds until status is completed or failed. Once completed, seconds is the actual length, cost_usd what you were charged, and content_url where to download it.

python
import time, requests

H = {"Authorization": f"Bearer {API_KEY}"}
video = requests.post("https://boldrouter.com/v1/videos", headers=H, json={
    "model": "google/gemini-omni-1.1-flash",
    "prompt": "A paper boat drifting on a calm pond at sunrise",
}).json()

while video["status"] in ("queued", "in_progress"):
    time.sleep(5)
    video = requests.get(f"https://boldrouter.com/v1/videos/{video['id']}", headers=H).json()

if video["status"] == "completed":
    mp4 = requests.get(video["content_url"], headers=H).content
    open("boat.mp4", "wb").write(mp4)
else:
    print(video["error"]["message"])

Download the video

GET/v1/videos/{id}/content

Returns the MP4 (H.264 with an audio track). Byte ranges are supported, so you can stream it to a player. Videos are kept for 30 days (expires_at); download the ones you want to keep.

Edit and extend a video

POST/v1/videos/{id}/remix
POST/v1/videos/{id}/extend

Edit one of your finished videos by describing the change, or continue it from its last frame. Each starts a new video, which you follow like any other; the original stays as it is.

bash
curl https://boldrouter.com/v1/videos/video_4bdf63d3fae6f69acd790312/extend \
  -H "Authorization: Bearer $BOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "The camera pulls back to reveal the whole lake", "seconds": 6 }'
FieldTypeDescription
prompt*stringThe change to make, or what happens next.
secondsintegerExtend only: how many seconds to add, 2 to 10 (default 6). An edit keeps the video's length.
modelstringDefaults to the model that made the video when it edits its own (Gemini Omni), otherwise xai/grok-imagine-video.
Editing modelWorks onEditExtend
google/gemini-omni-1.1-flashvideos it madeup to 10 s, at the source's resolution (up to 4K)adds 3-10 s, up to 40 s in all
xai/grok-imagine-videoany video, uploads tooup to 8.7 s, up to 720padds 2-10 s to a 2-15 s video
  • The result keeps the source's shape and resolution. An extension returns the whole video: the original followed by the new seconds.
  • Gemini Omni continues the job that made the video, so nothing is uploaded and an edit changes only what you describe. It bills per token as usual, plus about $0.003 per second of the source it reads.
  • The response says what was done: operation is edit or extend, and source_video_id the video it came from.

To edit or extend a video you didn't make here, send it as an MP4 (up to 20 MB, with Grok) to POST /v1/videos/edits or POST /v1/videos/extensions, with the same fields plus "video": "data:video/mp4;base64,...".

List and delete

  • GET /v1/videos lists your videos, newest first (limit, up to 100, and after for the next page).
  • DELETE /v1/videos/{id} deletes a finished video and its file.
  • A workspace member's key sees only the videos that member made.

Pricing

You pay what the provider bills. When you start a video, the most it could cost is held from your balance, and released when it finishes.

Per second of video480p720p1080p
Grok Imagine Video 1.5 Lite$0.02$0.04$0.14
Grok Imagine Video 1.5$0.08$0.14$0.25
Grok Imagine Video (and its edits and extensions)$0.05$0.07-

A Grok edit or extension bills the seconds it makes (the whole video for an edit, the added seconds for an extension) plus about $0.01 per second of the source: editing a 4 second 480p video costs about $0.24. A Gemini Omni edit or extension bills like a new video of the seconds it makes, plus the source it reads: about $0.11 for 3 seconds at 360p.

Gemini Omni Flash bills per token: the prompt, the model's thinking, and the video itself. That's about $0.035 per second at 360p and about $0.10 per second at 720p, so a 6 second 720p clip costs around $0.60.

A video that fails is free. So is one Google's safety filters block; xAI charges for a video its moderation blocks, and so that one is billed (the error says so). Up to 5 videos can be generating at once per account (429 after that).

Good to know

  • Prompts and images that break the provider's usage policies are refused with a 400 saying so, for example images of recognizable people, or of minors in the EU, Switzerland and the UK.
  • With a starting image, Grok keeps the image's shape; aspect_ratio and size then describe what was asked for, not the file.
  • Omni videos carry Google's invisible SynthID watermark. Prompts in English work best.
  • By default Omni may cut between a few shots. Ask for "a single continuous shot" if you want one, and say "no dialogue" or describe the sound you want.
  • Prompts can be anonymized like chat messages: send "anonymize": true. For workspace members with data protection on it always happens. Images aren't checked for private information.