Skip to content
Docs

Video Generations

Asynchronous pass-through API for upstream video generation tasks.

Endpoints

http
1POST /v1/contents/generations/tasks2GET /v1/contents/generations/tasks/{task_id}3DELETE /v1/contents/generations/tasks/{task_id}4Content-Type: application/json

Create a task

Send the upstream video request body as JSON. The model must be enabled for your workspace and routed to a channel that supports video task generation.

bash
1curl -X POST "$UNI_API_BASE_URL/contents/generations/tasks" \2  -H "Authorization: Bearer $UNI_API_KEY" \3  -H "Content-Type: application/json" \4  -d '{5    "model": "seedance-2-0",6    "content": [7      {8        "type": "text",9        "text": "A ginger cat sunbathes by a window, slow dolly-in, warm natural light, cinematic detail"10      }11    ],12    "ratio": "16:9",13    "duration": 5,14    "resolution": "720p",15    "generate_audio": false,16    "watermark": false,17    "seed": -118  }'

Poll for the result

The create response returns a task id. Poll that id until the upstream response reaches a terminal state. A successful response usually includes a video URL and a usage object.

bash
1curl "$UNI_API_BASE_URL/contents/generations/tasks/cgt-your-task-id" \2  -H "Authorization: Bearer $UNI_API_KEY"
json
1{2  "id": "cgt-your-task-id",3  "status": "succeeded",4  "content": {5    "video_url": "https://example.com/generated-video.mp4"6  },7  "usage": {8    "completion_tokens": 108900,9    "total_tokens": 10890010  }11}

Cancel or delete

Use the delete route when the upstream provider supports task cancellation or deletion.

bash
1curl -X DELETE "$UNI_API_BASE_URL/contents/generations/tasks/cgt-your-task-id" \2  -H "Authorization: Bearer $UNI_API_KEY"

Pass-through and billing

  • Uni API forwards the request body, compatible headers, and query string upstream.
  • Response status, body, and response type are returned from the upstream provider.
  • When a poll response returns status: succeeded with usage tokens, Uni API records the token usage once for billing and logs.
  • If you query a task that was not created through this Uni API deployment, add ?model=... so the gateway can route the poll request to the right upstream channel.