Skip to content
Docs

Developers

REST API quickstart

JSON over HTTPS with an API key. Create a video, poll until it is done, download it. The same calls work from any language; the examples use curl (and jq to read answers).

Base URL
https://gw.video/api/v1/public
Sign-in
Authorization: Bearer YOUR_KEY on every request (no cookies)
Format
JSON in and out; errors are {"error": "…", "code": "…"}
Price
Works with a Day Pass ($4.65 for 24 hours of unlimited videos, nothing to count), with Pay as you go ( $2.00 per render hour , charged per second while a video renders) and on Enterprise ($980 per month: unlimited videos, 4K and dedicated render capacity)
Pay as you go
You pay only for the time your videos render — not for how long you have an account. Keep your account for a month and render for 2 hours: you pay for 2 hours.

1. Set up

Create a key in Account → API keys with videos:read, videos:write and account:read, then keep it in your shell:

export API=https://gw.video/api/v1/public
export KEY=YOUR_KEY

Check the key and your balance:

curl -s $API/account/balance -H "Authorization: Bearer $KEY"

The answer says what you pay with right now. unlimited is true while a Day Pass or Enterprise is active, and pass says which one and when it ends (pass.name, pass.ends_at, pass.seconds_left): nothing is counted or charged per video then. Otherwise balance is the render time you have left on Pay as you go. plan_name is the name of your plan (Pay as you go or Enterprise); plan keeps the keys it always had (starter, pro, advanced), so an integration that reads it keeps working.

2. See what you can use

Modes, qualities and their maximum lengths, shapes, frame rates, voices, styles, camera moves, upload types and your limits, as your account can use them right now:

curl -s $API/models/options -H "Authorization: Bearer $KEY" | jq '{styles: [.styles[].id], camera_motions: [.camera_motions[].id], style_rules}'

The answer's styles list each style's id, name, group, description, example prompt, the modes it works in, its default strength and whether it is available to you (styles are on every account, except the camera styles, which are switched on account by account); camera_motions list the camera moves, on every account, with a description and example; style_rules say how many styles one video may use and the strength range. engine_ready is false for a few minutes while render capacity warms up (videos still queue). All the ids are in the styles & camera moves guide.

3. Create a video

curl -s $API/videos \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: fox-on-ice-1" \
  -d '{
    "prompt": "A little fox in a knitted scarf ice-skates across a frozen pond at dusk, wobbles, then spins in a proud circle. Snowy pines and a tiny cabin with a glowing window behind it. The scrape of skates on ice and a hooting owl.",
    "styles": ["clay-story"],
    "camera_motion": "push-in",
    "tier": "720p",
    "aspect": "9:16",
    "seconds": 8
  }'

The answer (201) comes at once, with the video waiting in the queue:

{
  "id": "01JD7Q0V9W6K3M2N8P4R5T7XYZ",
  "ids": ["01JD7Q0V9W6K3M2N8P4R5T7XYZ"],
  "videos": [{"id": "01JD7Q0V9W6K3M2N8P4R5T7XYZ", "status": "queued", "queue_position": 1, "mode": "text",
              "tier": "720p", "aspect": "9:16", "seconds": 8, "estimate_seconds": {"p50": 70, "p90": 83}, "outputs": []}]
}

4. Follow it and download

curl -s $API/videos/VIDEO_ID -H "Authorization: Bearer $KEY"

status is queued, running, done, failed or cancelled; stage and note say what is happening in plain words. When it is done, each entry of outputs has a download_url (and a thumbnail_url) valid for about 10 minutes; ask again for a fresh link.

{
  "id": "01JD7Q0V9W6K3M2N8P4R5T7XYZ", "status": "done", "render_seconds": 61,
  "outputs": [{"index": 0, "width": 720, "height": 1280, "seconds": 8.04,
               "download_url": "https://…", "thumbnail_url": "https://…", "expires_in": 600}]
}

A small polling loop that saves the file:

ID=VIDEO_ID
while :; do
  V=$(curl -s $API/videos/$ID -H "Authorization: Bearer $KEY")
  S=$(echo "$V" | jq -r .status); echo "$S $(echo "$V" | jq -r '.stage // ""')"
  case $S in done|failed|cancelled) break;; esac
  sleep 15
done
curl -L -o video.mp4 "$(echo "$V" | jq -r '.outputs[0].download_url')"

Videos take minutes: a waiting video starts when the one before it finishes (1 renders at a time per account, 2 more can wait). Poll every 10–30 seconds, not in a tight loop.

5. List and cancel

# newest first; "next" is the cursor for the following page
curl -s "$API/videos?limit=10&status=done" -H "Authorization: Bearer $KEY"
curl -s "$API/videos?limit=10&before=NEXT_CURSOR" -H "Authorization: Bearer $KEY"

# cancel a video that is still waiting (free); once it starts rendering it finishes by itself
curl -s -X POST $API/videos/VIDEO_ID/cancel -H "Authorization: Bearer $KEY"

# archive a finished video (nothing is deleted: it leaves the list and still downloads by id), list or restore it
curl -s -X POST $API/videos/VIDEO_ID/archive -H "Authorization: Bearer $KEY"
curl -s "$API/videos?archived=true" -H "Authorization: Bearer $KEY"
curl -s -X POST $API/videos/VIDEO_ID/restore -H "Authorization: Bearer $KEY"

The list carries no download links: get one video for its link. Archived videos are left out of the list (archived=true lists only them), keep every file and still expire on the normal schedule. Story projects archive and restore the same way (POST /projects/PROJECT_ID/archive, /restore, GET /projects?archived=true).

6. Animate your own picture

Files never go through the API itself: ask for a one-time upload link, PUT the bytes there, then use the upload id.

# a) ask for an upload link (content_type and size must match the file exactly)
SIZE=$(wc -c < shop.jpg | tr -d ' ')
curl -s $API/uploads -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d "{\"content_type\": \"image/jpeg\", \"size\": $SIZE, \"field\": \"image\", \"filename\": \"shop.jpg\"}"
# answer: {"id": "UPLOAD_ID", "method": "PUT", "url": "https://…", "headers": {"Content-Type": "image/jpeg", "Content-Length": "…"}, …}

# b) upload the file to "url" with those headers
curl -X PUT "UPLOAD_URL" -H "Content-Type: image/jpeg" --data-binary @shop.jpg

# c) make the video from it
curl -s $API/videos -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"mode": "image", "image": "UPLOAD_ID", "prompt": "Morning light spreads across the shop front as the shutters roll up and the first customers stroll past.", "camera_motion": "rise-up", "tier": "1080p", "aspect": "16:9", "seconds": 6}'

7. Plan with the AI director

Don't want to choose the mode, quality and length yourself? Send the request in plain words. The director answers with a checked plan and an estimate (the render time it uses and its cost on Pay as you go; with a Day Pass or Enterprise nothing is charged); nothing renders until you execute it. Planning is free (20 plans per hour).

curl -s $API/director/plan -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"request": "A 15-second vertical video of a barista pouring latte art at sunrise in 1080p, glossy commercial look, slow push in"}'
{
  "id": "PLAN_ID",
  "plan": {"kind": "single", "title": "Latte art at sunrise", "explanation": "…",
           "single": {"mode": "text", "prompt": "…", "tier": "1080p", "aspect": "9:16", "seconds": 15,
                      "styles": [{"id": "studio-commercial", "strength": 1.0}], "camera_motion": "push-in", …}},
  "summary": "Text → Video · 1080p · 9:16 · 15 s · style Studio Commercial ×1 · camera Push In",
  "chosen": [{"key": "quality", "label": "Quality", "value": "1080p", "why": "as you asked"}, …],
  "estimate": {"charge_hms": "0:09:37", "cost": "$0.32", …}
}
curl -s $API/director/execute -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"plan_id": "PLAN_ID"}'

8. Several shots in one clip

One clip can hold 2–4 shots joined by cuts (up to 20 s, 10 s at 1440p, 10 s at 4K, 5 s at 4K native; each shot at least 2 s). It renders in one go, so the sound can carry on across the cuts. There is no extra field on /videos: write the shots into the prompt yourself, or let the director plan them.

Write it yourself

One paragraph, the shots in order. Open each shot after the first with its cut (“A hard cut transitions to …”, “A match cut transitions to …”, “A dissolve transitions to …”), say the shot size, the subject and the light again after every cut, and say whether the sound carries on. Describe each shot's camera in words, leave camera_motion out and keep enhance off (the prompt enhancer rewrites the prompt, cuts included; the director switches it off for multi-shot clips).

curl -s $API/videos -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{
    "prompt": "Close-up of flour-dusted hands shaping a round loaf on a wooden table in a small bakery. Warm early-morning light from a high window. The soft thud of dough and a radio playing quietly. A hard cut transitions to a wide shot of the small bakery, where a grey-haired baker in a white apron slides a tray of golden loaves onto the counter as the first customer walks in. Warm early-morning light from a high window. The radio carries on across the cut, and the door bell rings.",
    "tier": "720p",
    "aspect": "16:9",
    "seconds": 10
  }'

More example prompts for each kind of cut: Multi-shot clips.

One call: shots in, one clip out

The same clip is Quick shot › More options › Native multi-shot in the studio. POST /multishot takes 2–4 shots and makes them as one clip in a project (a new one, or project_id), with your library characters (CH- ids), voice (VC- / VR-) and music (MU-, mixed in when you export the project):

curl -s $API/multishot -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{
    "shots": [{"prompt": "Wide shot: a cyclist crests a misty hill at dawn", "seconds": 5},
              {"prompt": "Close-up: her face, breath in the cold air", "seconds": 5},
              {"prompt": "Low angle: the bike speeds past the camera", "seconds": 5}],
    "title": "Dawn ride", "aspect": "9:16", "music": "MU-ABC234"
  }'

It answers with the project_id and the clip's video_id; follow the project with GET /projects/<id>, then POST /projects/<id>/exports for the file with the music. In story projects the same is automatic: "multishot": "auto" (the default) makes 2–4 cut shots of a scene one clip, "chain": "auto" starts a shot that goes on in the same scene on the last frame of the one before, and each shot's "clip" (auto, join, alone) overrides it.

Let the director plan it

Name the cuts or number the shots in a plain request. The plan is one clip with the shots in plan.single.multi_shot, and its prompt written from them (the answer below is abridged: the full one also has the plan's explanation, notes, estimate, fps, variants and the other clip fields):

curl -s $API/director/plan -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"request": "A 15-second vertical ad for our water bottle: a close-up of the bottle on a wet rock at dawn, cut to a runner drinking from it, match cut to the rising sun. Glossy commercial look, the same beat all the way through."}'
{
  "id": "PLAN_ID",
  "plan": {
    "kind": "single",
    "title": "Water bottle at dawn",
    "single": {
      "mode": "text", "tier": "draft", "aspect": "9:16", "seconds": 15,
      "styles": [{"id": "studio-commercial", "strength": 1.0}], "camera_motion": "",
      "prompt": "Close-up of a matte black water bottle on a wet rock at dawn. Droplets of water slide down its side. Slow push in. Cool blue morning light. Sound: a soft electronic beat. A hard cut transitions to a medium shot of a young woman in running gear on a coastal path. She stops, drinks from the bottle and twists its round silver cap shut. Handheld, following her. Cool blue morning light. The sound carries on across the cut. A match cut transitions to a wide shot of the round sun rising over the sea behind the young woman on the cliff path. She runs on toward the light. The camera holds still. Warm golden sunrise light. The sound carries on across the cut. A calm voice says, \"Stay cold. Keep moving.\"",
      "multi_shot": [
        {"scale": "close-up", "subject": "a matte black water bottle on a wet rock at dawn", "action": "droplets of water slide down its side", "camera": "slow push in", "light": "cool blue morning light", "sound": "a soft electronic beat", "seconds": 5, "transition": "", "audio": ""},
        {"scale": "medium shot", "subject": "a young woman in running gear on a coastal path", "action": "she stops, drinks from the bottle and twists its round silver cap shut", "camera": "handheld, following her", "light": "cool blue morning light", "sound": "", "seconds": 5, "transition": "hard cut", "audio": "continues"},
        {"scale": "wide shot", "subject": "the round sun rising over the sea behind the young woman on the cliff path", "action": "she runs on toward the light", "camera": "the camera holds still", "light": "warm golden sunrise light", "sound": "a calm voice says, \"Stay cold. Keep moving.\"", "seconds": 5, "transition": "match cut", "audio": "continues"}
      ]
    }
  },
  "summary": "Text → Video · Draft (540p) · 9:16 · 15 s · 3 shots in one clip: close-up, hard cut to medium shot, match cut to wide shot · style Studio Commercial ×1"
}
Shot fieldWhat
"scale"The shot size and angle: close-up, medium shot, wide shot, low-angle shot, …
"subject"Who or what is in frame, in full in every shot (never “he” or “it”).
"action"What happens in the shot.
"camera"The shot's camera in words (“slow push in”, “handheld”), or empty.
"light"The light, said in every shot.
"sound"What is heard; spoken words in double quotes.
"seconds"The shot's length, at least 2. The shots add up to the clip's seconds.
"transition"How the shot begins: empty for the first shot, then "hard cut", "match cut" or "dissolve".
"audio"Empty for the first shot, then "continues" (the sound carries on across the cut) or "changes".

To change it, edit the plan and send it with the execute call as "plan". This one turns the first cut into a dissolve:

P=$(curl -s $API/director/plan -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"request": "A 15-second vertical ad for our water bottle: a close-up of the bottle on a wet rock at dawn, cut to a runner drinking from it, match cut to the rising sun. Glossy commercial look, the same beat all the way through."}')
echo "$P" | jq '{plan_id: .id, plan: (.plan | .single.multi_shot[1].transition = "dissolve")}' \
  | curl -s $API/director/execute -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -d @-

9. Longer stories

One clip holds up to 20 seconds. For a longer video with the same characters, make a Story project: describe each recurring character once, add short shots, render them in order and join them.

curl -s $API/projects -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"title": "The lighthouse keeper", "aspect": "16:9", "tier": "720p", "style": "painterly oil-painting look, warm amber light"}'

curl -s $API/projects/PROJECT_ID/bible -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"kind": "character", "name": "Mara", "description": "A woman in her sixties with a long grey braid, a yellow oilskin coat and a green wool scarf", "voice": "low and warm, with a soft Scottish accent"}'

curl -s $API/projects/PROJECT_ID/shots -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"prompt": "Mara climbs the spiral stairs of the lighthouse holding a lantern; wind howls outside.", "seconds": 6, "link": "cut", "characters": ["Mara"], "camera": "rise-up"}'

curl -s $API/projects/PROJECT_ID/shots -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"prompt": "She opens the lamp-room door and looks out at the storm.", "seconds": 6, "link": "continue", "characters": ["Mara"], "dialogue": "Mara: Right on time."}'

curl -s -X POST $API/projects/PROJECT_ID/render -H "Authorization: Bearer $KEY"
curl -s $API/projects/PROJECT_ID -H "Authorization: Bearer $KEY"          # shots, takes, progress
curl -s $API/projects/PROJECT_ID/exports -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"crossfade_ms": 250}'                                                 # join the shots (free)

10. Reusable characters

Make a character once and use it in any project: it keeps a locked main picture and a matching sheet, so every shot with it gets the same reference pictures and the face stays the same. Every character has a short ID such as CH-7K2M9Q (voices have VC- IDs). Characters are switched on account by account; until then these calls answer 403 characters_off. Reading needs videos:read, the rest videos:write.

curl -s $API/characters -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"name": "Asha", "description": "A 30-year-old runner with short black hair and a red jacket", "voice": "VC-7K2M9Q"}'
                                                                        # 4 picture options

curl -s $API/characters/CH-7K2M9Q/choose -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"image": "OPTION_ID"}'                                           # locks the main picture
curl -s -X POST $API/characters/CH-7K2M9Q/sheet -H "Authorization: Bearer $KEY"
                                                                        # front, side, 3/4, full body, 3 expressions
curl -s $API/characters/CH-7K2M9Q/edit -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"instruction": "make the jacket blue"}'
curl -s $API/characters/CH-7K2M9Q/use -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"project_id": "PROJECT_ID"}'                                     # into the project's cast, locked

11. Music

Make songs and background music on their own, or for a project. Every track has a short ID such as MU-7K2M9Q. Describe it (mood, genre, instruments, tempo, key, length up to 10 minutes), make it instrumental, or give lyrics to sing in many languages, Hindi included. A track is made in the background (usually one to three minutes) and is charged like a render: only the time it takes to make, from your render time. Music is switched on account by account; until then these calls answer 403 music_off. Reading needs videos:read, the rest videos:write.

curl -s $API/music -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"prompt": "warm lofi beat for a cooking video", "tags": ["lofi", "piano"], "seconds": 30, "instrumental": true}'
                                                                        # 202: {"id": "MU-7K2M9Q", "status": "working", ...}
curl -s $API/music/MU-7K2M9Q -H "Authorization: Bearer $KEY" | jq '{status, seconds, bpm, key, mp3_url, wav_url}'

curl -s $API/music -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"prompt": "bollywood pop, joyful", "seconds": 30, "language": "hi", "lyrics": "[verse]\nचलो चलें\n[chorus]\nसाथ गाएँ"}'

curl -s $API/music/MU-7K2M9Q/extend  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -d '{"add": 30, "outro": true}'
curl -s $API/music/MU-7K2M9Q/repaint -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -d '{"start": 8, "end": 14}'
curl -s $API/music/MU-7K2M9Q/remix   -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -d '{"prompt": "acoustic guitar", "strength": 0.6}'
curl -s $API/music/MU-7K2M9Q/cutdown -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -d '{"seconds": 15}'
curl -s $API/projects/PROJECT_ID/music -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"track": "MU-7K2M9Q"}'                                          # the project's music, cut to its beats

Video fields

FieldWhat
promptRequired. One flowing paragraph: subject, action, setting, camera, light, sound; dialogue in double quotes.
modetext (default); image needs image; flf needs image and last_image (or "loop": true to end on the first image); talk needs script (its length sets the clip's) and takes a voice and an optional host image; audio needs audio (and an optional image); ingredients needs refs (reference pictures, 16:9).
tierdraft (up to 20 s), 720p (up to 20 s), 1080p (up to 20 s), 1440p (up to 10 s), 4k (up to 10 s), 4k_native (up to 5 s). Draft or 720p to explore, 1080p for keepers. 4k and 4k_native are on Enterprise (403 enterprise_only otherwise; GET models/options shows which qualities your account can use). 4K: much longer processing time.
render_quality"full" (the default): Full quality, the full model at its best settings, wherever it is offered. "fast": quicker and uses less render time for the same clip, a different take of the same prompt (both are billed at the same rate per second; POST videos/quote compares them before you create). Full quality is offered for text and image at draft, 720p and 1080p up to 10 s (4k on Enterprise); elsewhere, and for ingredients and the video tools, a request that names no quality renders in Fast automatically. The answer's render_quality says which it got. A request that names no quality is never refused for it: while Full quality can't render right now it renders in Fast. An explicit "full" is refused with full_quality_unavailable then, unless queue_if_unavailable is true. Before creating, POST videos/quote with the same fields gives the time, hours and cost of both. Make final: POST videos/{id}/final; render_quality defaults to the draft's own quality, so the final keeps its look ("full" on a Fast draft is a new take: the answer's warning says so); a quote unless confirm: true.
aspect9:16, 16:9, 1:1, 4:5
seconds, fpsLength (2–20, per quality above); 24, 25 or 30 frames per second.
stylesUp to 3 style ids, optionally with a strength (every account; the camera styles on selected accounts). See the guide.
camera_motionOne camera move id: locked-off, push-in, rise-up, … On every account; not in ingredients mode, and left out of a multi-shot prompt. See the camera moves.
voiceTalking host voice: us-female-1, uk-female-1, us-female-2, uk-female-2, us-male-1, us-male-2, uk-male-1, uk-male-2 (default uk-female-1).
seed, variants, negative, enhanceA fixed seed reproduces a result; up to 2 variations; negative: what to keep out of the video (Full quality uses it, with a sensible default when empty; Fast ignores it); let the studio expand a short prompt.
likeness_consenttrue confirms you have the consent of every real person shown or heard in your files.

Errors and limits

StatusMeaning
400 / 415A field is wrong (the message says which), the body isn't JSON, or Content-Type: application/json is missing.
401Missing, wrong or revoked key.
402out_of_credits: you are out of render time (the message says how to go on: get a Day Pass or add render time). Reading, listing and downloading keep working. insufficient_time: the estimate doesn't fit the render time you have left (the message says how much is left and roughly how much the video needs). Neither is returned while a Day Pass or Enterprise is active.
403The key lacks a permission (insufficient_scope), the current terms aren't accepted yet, the account can't make videos right now, or the quality is on Enterprise (enterprise_only: 4K and 4K native).
404No such video, upload or project in your account (or API access isn't switched on yet).
409likeness_consent needed; the render has already started (render_started, cancel: it finishes by itself); the video has already finished (cancel); or it is still waiting, rendering or in the safety check (active, archive).
413Body over 1 MB: upload files, send long documents as text.
422The prompt was refused by the safety check.
429Over a limit: wait the seconds in Retry-After. Limits: 30 requests per minute and 100000 new videos per hour per key; 1 rendering and 2 waiting per account.

Every video passes the same automatic safety check as the studio and carries a content credential (C2PA) saying it is AI-generated. A prompt held for review waits, without charge, until our team checks it.