Skip to main content

Video generation workflow

Video API calls have three steps: create a task, check its status, and get the video. Use the same API key for all three requests. See video model parameters for model fields.

1. Submit a task​

Call POST /v1/videos with the model ID, prompt, and its parameters:

curl --request POST https://api.popgo.site/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_MODEL","prompt":"A calm seaside landscape"}'

Save the returned id for checking the task and getting the video.

If the creation request times out:

  • If you received an id, keep querying that task instead of creating another one.
  • If you did not receive an id, do not retry yet. Save the X-Oneapi-Request-Id response header if received, the request time, and the model name, then contact support to check the request. You currently cannot retrieve a task yourself using a request ID.

2. Check status​

Call GET /v1/videos/{task_id}:

curl https://api.popgo.site/v1/videos/YOUR_TASK_ID \
-H "Authorization: Bearer YOUR_API_KEY"

queued means waiting, in_progress means generating, completed means ready, and failed means an error occurred. Read error when failed.

3. Get the video​

When the task is complete, use GET /v1/videos/{task_id}/content to retrieve the video with the same PopGo API key:

curl --fail --location \
https://api.popgo.site/v1/videos/YOUR_TASK_ID/content \
-H "Authorization: Bearer YOUR_API_KEY" \
--output video.mp4

Send your PopGo API key only to https://api.popgo.site. You may also try opening video_url or metadata.url as ordinary links to play or download the video, but they may expire. Never send your PopGo API key to these links. If a link cannot be accessed directly, use the content endpoint above.

Video editing (supported models only)​

Video editing uses the same create, query, and retrieval workflow above. Use seconds for duration and reference_images, reference_videos, and reference_audios for image, video, and audio references. See the model's parameters for supported values and reference requirements.

View the editing parameters and example for seedance-2-5.