Videos API

AI video generation

Create videos from text and images, track progress and download MP4 through the Videos API.

Back to documentation

Connection and authentication

Base URL: https://thapi.cloud/v1

Authorization: Bearer $API_KEY

Set API_KEY in your environment. GET /v1/models checks authentication without creating a video.

read -r -s -p "API_KEY: " API_KEY
export API_KEY
printf '\n'
curl -fsS https://thapi.cloud/v1/models -H "Authorization: Bearer ${API_KEY:?API_KEY}"

cURL commands use Bash; on Windows, use the PowerShell setup. Replace sample media URLs with your own provider-accessible files.

Creating a video is billable. Save the id from a successful response to track the same job.

If a job fails after an id is returned, refunds depend on provider results and reconciliation. A failed status does not confirm an immediate Credits refund.

Polling, downloading and cancellation do not create another generation. Successful cancellation does not automatically reverse a recorded charge.

Models and capabilities

ModelVendorDuration (seconds)Price / videoReference images, max.Aspect ratiosResolution
st1/veo-3.1Google4 / 6 / 84,600 ST / 4,600 ST / 4,600 ST0–39:16, 16:9720p / 1080p
st1/seedance-2.0-noface-ecoByteDance4–15 seconds (1s steps)Default 10s = 3,700 ST0–1021:9, 16:9, 4:3, 1:1, 3:4, 9:16original
st1/seedance-2.0-nofaceByteDance4–15 seconds (1s steps)Default 10s = 12,600 ST0–1021:9, 16:9, 4:3, 1:1, 3:4, 9:16original
st1/seedance-2.0-miniByteDance4–15 seconds (1s steps)Default 5s = 13,400 ST0–921:9, 16:9, 4:3, 1:1, 3:4, 9:16720p / 1080p
st1/seedance-2.0-fastByteDance4–15 seconds (1s steps, Fast 720p)Default 5s = 21,300 ST0–921:9, 16:9, 4:3, 1:1, 3:4, 9:16720p / 1080p
st1/seedance-2.5-flashByteDance4–30 seconds (1s steps)Default 5s = 18,100 ST0–1021:9, 16:9, 4:3, 1:1, 3:4, 9:16480p
st1/seedance-2.5ByteDance4–30 seconds (1s steps)Default 5s = 40,700 ST0–1021:9, 16:9, 4:3, 1:1, 3:4, 9:16720p / 1080p
st1/wan-3.0Alibaba4–15 seconds (1s steps)63,300 ST0–1016:9, 9:16720p
st2/veo-3.1Google4 / 6 / 84,600 ST / 4,600 ST / 4,600 ST1–316:9, 9:16720p
st2/google-omni-flashGoogle5 / 1011,200 ST / 11,200 ST1–316:9, 9:16720p
st2/grok-imagine-video-1.5xAI6 / 10 / 1513,200 ST / 22,000 ST / 33,000 ST1–316:9, 9:16, 1:1, 4:3, 3:4720p
st2/seedance-2.0-mini-480pByteDance4–15 seconds (1s steps)Default 5s = 6,300 ST0–10auto / 21:9, 16:9, 4:3, 1:1, 3:4, 9:16480p
st2/seedance-2.0-mini-720pByteDance4–15 seconds (1s steps)Default 5s = 13,400 ST0–10auto / 21:9, 16:9, 4:3, 1:1, 3:4, 9:16720p
st2/seedance-2.0-fast-480pByteDance4–15 seconds (1s steps, Fast 720p)Default 5s = 9,900 ST0–10auto / 21:9, 16:9, 4:3, 1:1, 3:4, 9:16480p
st2/seedance-2.0-fast-720pByteDance4–15 seconds (1s steps, Fast 720p)Default 5s = 21,300 ST0–10auto / 21:9, 16:9, 4:3, 1:1, 3:4, 9:16720p
st2/seedance-2.0-480pByteDance4–15 seconds (1s steps)Default 5s = 12,400 ST0–10auto / 21:9, 16:9, 4:3, 1:1, 3:4, 9:16480p
st2/seedance-2.0-720pByteDance4–15 seconds (1s steps)Default 5s = 26,700 ST0–10auto / 21:9, 16:9, 4:3, 1:1, 3:4, 9:16720p
st2/seedance-2.0-1080pByteDance4–15 seconds (1s steps)Default 5s = 65,800 ST0–10auto / 21:9, 16:9, 4:3, 1:1, 3:4, 9:161080p
st2/seedance-2.5-480pByteDance4–30 seconds (1s steps)Default 5s = 18,100 ST0–10auto / 21:9, 16:9, 4:3, 1:1, 3:4, 9:16480p
st2/seedance-2.5-720pByteDance4–30 seconds (1s steps)Default 5s = 40,700 ST0–10auto / 21:9, 16:9, 4:3, 1:1, 3:4, 9:16720p
st2/seedance-2.5-1080pByteDance4–30 seconds (1s steps)Default 5s = 99,800 ST0–10auto / 21:9, 16:9, 4:3, 1:1, 3:4, 9:161080p

Five main Seedance models (ByteDance, st1/ line): 2.0-1080p, 2.0-720p, 2.0-fast-720p, 2.5-1080p, 2.5-720p. Billed by the exact seconds you send. Veo / Omni / Grok keep fixed duration price tables.

One image via input_reference/images is the first frame (aspect auto). Use reference_image_urls or omni_reference_task_type=reference to guide content with a fixed aspect ratio.

veo-3.1 accepts only 4, 6 or 8. google-omni-flash accepts only 5 or 10. grok-imagine-video-1.5 accepts only 6, 10 or 15. Check seconds in the response.

Endpoints and parameters

POST /v1/videos — create a job

Send application/json. This endpoint reads JSON, not multipart/form-data; use URLs or image JSON supported by the model.

ParameterRequirementUsage
modelRequiredAn available video model ID; set it explicitly rather than relying on a default.
promptRequiredDescribe the subject, setting, action and camera movement.
secondsOptionalFollow the model table. veo-3.1 defaults to 8s; google-omni-flash to 10s; grok-imagine-video-1.5 to 6s.
aspect_ratioOptionalFor example 16:9 or 9:16 depending on the model. Keep it consistent with size.
sizeOptionalDimensions such as 1280x720 or 720x1280. Accepted sizes depend on the model.
images / input_referenceOptionalStarting/reference images via URL/JSON. The entire body is limited to 2047 MB; provider image limits also apply.
reference_image_urlsOptionalreference_image_urls: reference images (reference mode; not locked as the first frame).
omni_reference_task_typeOptionalomni_reference_task_type: set "reference" when using reference images with a fixed aspect_ratio.
last_frameOptionalEnd frame for veo-3.1 or grok-imagine-video-1.5, with the same input_reference.
input_videoOptionalSource MP4 URL for google-omni-flash video-to-video.
resolutionOptionalSome models support 720p or 1080p (default 720p). Others may ignore it or derive from size.
generate_audioOptionalSome video models may ignore generate_audio / reference_audios.

GET /v1/videos/{id} — track progress

Pass ?model= matching the creation model. Recommended poll interval: 10s (back off on HTTP 429).

  • queued: the job was accepted and is waiting.
  • in_progress: the provider is processing the job.
  • completed: the result can be downloaded.
  • failed: inspect error and keep the id for support.
{
  "id": "video_abc123",
  "object": "video",
  "model": "st2/seedance-2.0-720p",
  "status": "completed",
  "progress": 100,
  "seconds": "10",
  "size": "1280x720",
  "error": null
}

GET /v1/videos/{id}/content — download MP4

Download only after completed. Send the same API key and ?model=; save the binary response as .mp4.

DELETE /v1/videos/{id} — request cancellation

Cancellation depends on the route and job state; some routes currently do not support DELETE. Cancellation does not guarantee a refund.

Pricing by duration

Prices follow this website’s current configuration, including applicable adjustments. Check them before creating a video.

Seedance duration pricing. Unit: VND per successful video. 4–15s or 4–30s is the supported duration range, not a flat package price. Choose seconds within the supported range; exact prices are listed below. Any fixed generation fee is already included.

st1/seedance-2.0-noface-eco

If seconds is omitted: 10s = 3,700 ST.

Duration / SecondsPrice / video
10s3,700 ST
15s5,000 ST

st1/seedance-2.0-noface

If seconds is omitted: 10s = 12,600 ST.

Duration / SecondsPrice / video
10s12,600 ST
15s16,400 ST

st1/seedance-2.0-mini

If seconds is omitted: 5s = 13,400 ST.

Duration / SecondsPrice / video
5s13,400 ST
10s26,700 ST
15s40,000 ST

st1/seedance-2.0-fast

If seconds is omitted: 5s = 21,300 ST.

Duration / SecondsPrice / video
5s21,300 ST
10s42,500 ST
15s63,800 ST

st1/seedance-2.5-flash

If seconds is omitted: 5s = 18,100 ST.

Duration / SecondsPrice / video
5s18,100 ST
10s36,200 ST
15s54,200 ST
30s108,400 ST

st1/seedance-2.5

If seconds is omitted: 5s = 40,700 ST.

Duration / SecondsPrice / video
5s40,700 ST
10s81,300 ST
15s121,800 ST
30s243,500 ST

st2/seedance-2.0-mini-480p

If seconds is omitted: 5s = 6,300 ST.

Duration / SecondsPrice / video
4s5,100 ST
5s6,300 ST
6s7,600 ST
7s8,800 ST
8s10,000 ST
9s11,200 ST
10s12,500 ST
11s13,700 ST
12s14,900 ST
13s16,100 ST
14s17,400 ST
15s18,600 ST

st2/seedance-2.0-mini-720p

If seconds is omitted: 5s = 13,400 ST.

Duration / SecondsPrice / video
4s10,800 ST
5s13,400 ST
6s16,100 ST
7s18,700 ST
8s21,400 ST
9s24,100 ST
10s26,700 ST
11s29,400 ST
12s32,100 ST
13s34,700 ST
14s37,400 ST
15s40,000 ST

st2/seedance-2.0-fast-480p

If seconds is omitted: 5s = 9,900 ST.

Duration / SecondsPrice / video
4s7,900 ST
5s9,900 ST
6s11,800 ST
7s13,800 ST
8s15,800 ST
9s17,700 ST
10s19,700 ST
11s21,700 ST
12s23,600 ST
13s25,600 ST
14s27,600 ST
15s29,500 ST

st2/seedance-2.0-fast-720p

If seconds is omitted: 5s = 21,300 ST.

Duration / SecondsPrice / video
4s17,000 ST
5s21,300 ST
6s25,500 ST
7s29,800 ST
8s34,000 ST
9s38,300 ST
10s42,500 ST
11s46,800 ST
12s51,000 ST
13s55,300 ST
14s59,500 ST
15s63,800 ST

st2/seedance-2.0-480p

If seconds is omitted: 5s = 12,400 ST.

Duration / SecondsPrice / video
4s9,900 ST
5s12,400 ST
6s14,900 ST
7s17,300 ST
8s19,800 ST
9s22,300 ST
10s24,800 ST
11s27,200 ST
12s29,700 ST
13s32,200 ST
14s34,600 ST
15s37,100 ST

st2/seedance-2.0-720p

If seconds is omitted: 5s = 26,700 ST.

Duration / SecondsPrice / video
4s21,400 ST
5s26,700 ST
6s32,000 ST
7s37,300 ST
8s42,600 ST
9s47,900 ST
10s53,200 ST
11s58,600 ST
12s63,900 ST
13s69,200 ST
14s74,500 ST
15s79,800 ST

st2/seedance-2.0-1080p

If seconds is omitted: 5s = 65,800 ST.

Duration / SecondsPrice / video
4s52,600 ST
5s65,800 ST
6s78,900 ST
7s92,000 ST
8s105,200 ST
9s118,300 ST
10s131,500 ST
11s144,600 ST
12s157,700 ST
13s170,900 ST
14s184,000 ST
15s197,200 ST

st2/seedance-2.5-480p

If seconds is omitted: 5s = 18,100 ST.

Duration / SecondsPrice / video
4s14,500 ST
5s18,100 ST
6s21,700 ST
7s25,300 ST
8s29,000 ST
9s32,600 ST
10s36,200 ST
11s39,800 ST
12s43,400 ST
13s47,000 ST
14s50,600 ST
15s54,200 ST
16s57,900 ST
17s61,500 ST
18s65,100 ST
19s68,700 ST
20s72,300 ST
21s75,900 ST
22s79,500 ST
23s83,100 ST
24s86,800 ST
25s90,400 ST
26s94,000 ST
27s97,600 ST
28s101,200 ST
29s104,800 ST
30s108,400 ST

st2/seedance-2.5-720p

If seconds is omitted: 5s = 40,700 ST.

Duration / SecondsPrice / video
4s32,600 ST
5s40,700 ST
6s48,800 ST
7s57,000 ST
8s65,100 ST
9s73,200 ST
10s81,300 ST
11s89,400 ST
12s97,500 ST
13s105,600 ST
14s113,700 ST
15s121,800 ST
16s130,000 ST
17s138,100 ST
18s146,200 ST
19s154,300 ST
20s162,400 ST
21s170,500 ST
22s178,600 ST
23s186,700 ST
24s194,800 ST
25s202,900 ST
26s211,100 ST
27s219,200 ST
28s227,300 ST
29s235,400 ST
30s243,500 ST

st2/seedance-2.5-1080p

If seconds is omitted: 5s = 99,800 ST.

Duration / SecondsPrice / video
4s79,900 ST
5s99,800 ST
6s119,800 ST
7s139,700 ST
8s159,700 ST
9s179,600 ST
10s199,600 ST
11s219,600 ST
12s239,500 ST
13s259,500 ST
14s279,400 ST
15s299,400 ST
16s319,300 ST
17s339,300 ST
18s359,200 ST
19s379,200 ST
20s399,200 ST
21s419,100 ST
22s439,100 ST
23s459,000 ST
24s479,000 ST
25s498,900 ST
26s518,900 ST
27s538,800 ST
28s558,800 ST
29s578,800 ST
30s598,700 ST

Other video models

ModelDuration (seconds)Price / video
st1/veo-3.144,600 ST
st1/veo-3.164,600 ST
st1/veo-3.184,600 ST
st1/wan-3.0563,300 ST
st2/veo-3.144,600 ST
st2/veo-3.164,600 ST
st2/veo-3.184,600 ST
st2/google-omni-flash511,200 ST
st2/google-omni-flash1011,200 ST
st2/grok-imagine-video-1.5613,200 ST
st2/grok-imagine-video-1.51022,000 ST
st2/grok-imagine-video-1.51533,000 ST

Seedance bills by the seconds you send. Veo / Omni / Grok keep fixed duration price tables.

View all pricing

Integration examples

Each POST creates a billable video. Choose one example; example.com media URLs are placeholders and must be replaced.

import os
import time
from getpass import getpass
from urllib.parse import quote
import requests
from requests.adapters import HTTPAdapter

api_key = os.getenv("STALI_API_KEY") or getpass("STALI_API_KEY: ")
headers = {"Authorization": f"Bearer {api_key}"}
model = "st2/seedance-2.0-720p"
http = requests.Session()
http.mount("https://", HTTPAdapter(max_retries=0))
created = http.post("https://thapi.cloud/v1/videos", headers=headers, json={
    "model": model, "prompt": "Cinematic sunset over ocean waves",
    "seconds": 5, "aspect_ratio": "16:9",
}, timeout=(10, 120))
print("Request ID:", created.headers.get("x-request-id") or created.headers.get("x-stali-request-id", ""), flush=True)
created.raise_for_status()
video = created.json()
video_id = video["id"]
with open("video-job.txt", "w") as f:
    f.write(f"{video_id}\t{model}\n")
print(video_id, video.get("status"), "(da luu vao video-job.txt)", flush=True)

job_url = "https://thapi.cloud/v1/videos/" + quote(video_id, safe="")
han_chot = time.monotonic() + 1800
cho = 5
while video.get("status") not in ("completed", "failed"):
    if time.monotonic() > han_chot:
        raise SystemExit(
            f"Het thoi gian cho phia client. Tac vu CO THE VAN DANG CHAY.\n"
            f"Tiep tuc bang: python resume.py {video_id} {model}\n"
            f"Dung tao video moi — lenh POST da tinh phi roi."
        )
    time.sleep(cho)
    progress = http.get(job_url, headers=headers, params={"model": model}, timeout=(10, 60))
    if progress.status_code in (429, 500, 502, 503, 504):
        cho = min(cho * 2, 60)
        sau = progress.headers.get("retry-after")
        if sau and sau.isdigit():
            cho = max(cho, int(sau))
        print(video_id, f"upstream {progress.status_code}, cho {cho}s roi thu lai", flush=True)
        continue
    progress.raise_for_status()
    cho = 5
    video = progress.json()
    print(video_id, video.get("status"), flush=True)

if video.get("status") != "completed":
    raise RuntimeError(str(video))

content = http.get(job_url + "/content", headers=headers, params={"model": model}, stream=True, timeout=(10, 120))
content.raise_for_status()
tam = f"{video_id}.mp4.part"
with open(tam, "wb") as output:
    for chunk in content.iter_content(chunk_size=65536):
        if chunk:
            output.write(chunk)
os.replace(tam, f"{video_id}.mp4")
print("da luu", f"{video_id}.mp4", flush=True)

Error handling

HTTPCauseAction
400Invalid parameters or unsupported cancellation.Check JSON, seconds, images and model support.
401Missing or invalid key.Check authentication headers and active key.
402HTTP 402: check error.type, remaining Credits, key spend limit, or outstanding balance from prior requests.Inspect error.type: insufficient_balance → check remaining Credits; api_key_monthly_limit → adjust key limit in Dashboard → Keys; outstanding_undercharge → reconcile prior call balance. See /docs/reference/errors.
403Request is not permitted.Check key permissions, model and content policy.
404Model or job not found on this route.Use the original id, key and ?model=.
409Job is not ready for this operation.Keep polling; download after completed.
413Request body exceeds the limit.Reduce body size; use URLs instead of large embedded media.
429Rate or concurrency limit exceeded.Back off and reduce concurrent jobs.
502Provider route response error.Keep the request ID; do not auto-repeat POST.

Do not automatically repeat POST after a timeout or network error: the first request may have been accepted. If you have an id, poll it; otherwise keep the request ID and check Usage or contact support before recreating.

Prompt design

These are creative guidelines, not a guarantee that a provider will reproduce every detail. Each model’s content policy still applies.

Write a clear prompt

  1. Define subject, setting and main action before effects.
  2. Set duration with seconds, not only in the prompt.
  3. Keep left/right positions and outfits consistent across shots.
  4. Prefer one clear camera movement per shot.
  5. Describe light sources, colors and materials.
  6. Avoid small text, logos or exact numbers in frame.
  7. Start with one short scene; change one factor at a time after reviewing.

Arrange reference images

  • Number Image 1, Image 2… in submission order.
  • State which image controls character, outfit or setting.
  • Use authorized, clear images with a consistent visual direction.
  • Match characters and composition in first/last frames for natural motion.
  • Stay within the model’s image limit; references do not guarantee exact reproduction.

Prompt template

Generate immediately in 16:9 widescreen as one continuous three-shot sequence.
The reference images are colored-pencil character design sketches: use them only for design and outfits. Render the video as a photoreal 3D CG game cinematic with dramatic lighting.
Image 1 = PROTAGONIST: [character design].
Image 2 = ANTAGONIST: [opponent design].
Image 3 = ENVIRONMENT: [setting].
FIXED LAYOUT: altar in the background CENTER; protagonist on the LEFT; antagonist on the RIGHT. Nobody disappears, teleports or swaps sides.
LIGHTING: torchlight from the left wall, cool moonlight from the ceiling.
Action: well-choreographed, orbiting camera. Sparks and dark smoke on impact only; no blood, no wounds, no gore.
Sound: heavy impacts, wind, no dialogue.
Shot 1: camera pushes in, protagonist draws a weapon, antagonist raises claws.
Shot 2: fast exchange, camera orbits smoothly around both fighters.
Shot 3: climax, both stay on their sides, protagonist lands in a ready stance.
Keep faces and outfits consistent. No text, no numbers, no subtitles, no watermark.

The template guides the scene. Shorten it if actions are missed; do not use prose instead of API parameters.

Describe non-graphic action

Avoid graphic detailSafer visual direction
blood, wound, gore, corpsesparks, black smoke, torn fabric only
Pool of bloodmurky grey mist, dark viscous puddle
Injury-causing attackglowing wisps of spirit-light, shadowy aura
Cut on skintearing only the fabric of the sleeve, no blood

Build a sequence

  1. Split the story into scenes with clear starts and ends.
  2. Reuse character descriptions, lighting and references.
  3. Download and review each scene before generating the next.
  4. Join scenes in an editor; each POST remains a separate billable job.

When results miss the mark

  • Missing actions: reduce events in one scene.
  • Swapped positions: specify left/right and stable composition.
  • Inconsistency: reuse references and identifying details.
  • Wrong duration: check seconds and fixed-duration models.
  • Rejected: review error and content policy; do not repeatedly resend the same request.

Review motion with a frame grid

ffmpeg -i clip.mp4 -vf "fps=1,scale=320:-1,tile=6x5" -frames:v 1 frame_grid.png

This ffmpeg command reads local clip.mp4 and creates a frame grid without calling the API. Install ffmpeg first.

Preflight checklist

  • Choose the correct model ID and supported duration.
  • Check pricing and balance before creating.
  • Keep keys server-side, out of public browser code.
  • Use JSON and provider-accessible media URLs.
  • Save id, model and request ID for tracking.
  • Poll the same id with ?model= and back off when limited.
  • Download after completed and verify the MP4 file.
  • Do not recreate automatically when acceptance is uncertain.
  • Review errors and costs in Usage; send the id to support if needed.