Videos

Quickstart

Submit a text-to-video job, wait for it to finish, and download the MP4.

Before you start

  1. A TokenFactory API key (tf_…) from your dashboard. See Authentication.
  2. An HTTP client. The examples use curl, Python (httpx) and JavaScript (fetch).
shell
export TF_BASE_URL=https://tokenfactory.fast/api
export TF_API_KEY=tf_...

1. Submit a job

curl -sS -X POST "$TF_BASE_URL/v1/videos" \
  -H "Authorization: Bearer $TF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax/h3",
    "task": "t2va",
    "prompt": "a paper boat drifting down a rain-slicked street at night, neon reflections",
    "seconds": 5,
    "quality": "turbo"
  }'

The response is 201 and returns straight away, before any GPU work has started:

response
{
  "id": "vid_9f2a...",
  "status": "queued",
  "model": "minimax/h3",
  "created_at": "2026-10-17T18:04:02Z",
  "eta_seconds": 60
}

2. Check the job status

Poll GET /v1/videos/{id} every 3 to 5 seconds until status is completed. Stop and report if it becomes failed or canceled. Polling faster does not make the job faster; there is no progress percentage.

curl -sS "$TF_BASE_URL/v1/videos/$JOB_ID" -H "Authorization: Bearer $TF_API_KEY"
response while running
{
  "id": "vid_9f2a...",
  "status": "processing",
  "progress": null,
  "created_at": "2026-10-17T18:04:02Z",
  "started_at": "2026-10-17T18:04:20Z",
  "completed_at": null
}

3. Download the video

GET /v1/videos/{id}/content answers with a 302 redirect to a short-lived signed URL for the MP4. Follow the redirect and save the body.

curl -sS -L "$TF_BASE_URL/v1/videos/$JOB_ID/content?variant=0" -H "Authorization: Bearer $TF_API_KEY" -o out.mp4

Output is H.264 video at 24 fps with stereo AAC audio. Next: image and reference inputs.