Video generation
Video generation is asynchronous. Create a task, poll its status, and download content only after it reaches completed.
Endpoints
Section titled “Endpoints”| Action | Method and path |
|---|---|
| Create | POST /v1/video/generations |
| Status | GET /v1/video/generations/{task_id} |
| Download | GET /v1/videos/{task_id}/content |
A create request requires model and prompt. Support for duration, seconds, image(s), size, and metadata depends on the selected model.
curl https://api.nexinfer.com/v1/video/generations \ -H "Authorization: Bearer $NEXINFER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-2-0-260128", "prompt": "A calm ocean at sunrise", "duration": 4, "metadata": {"resolution": "720P"} }'The returned id is the public NexInfer task ID. States include queued, in_progress, completed, and failed. Use bounded polling and never retry a failed paid task indefinitely.
Network interruption and settlement
Section titled “Network interruption and settlement”- Once a task ID is returned, a client disconnect does not cancel the asynchronous task. Resume polling the same ID.
- If the create connection ends before the client receives an ID, the outcome is unknown. Keep the request ID and check usage/support before submitting the same paid job again.
- Successful tasks settle from the model provider’s reported
total_tokens. A terminalfailedtask or platform task timeout refunds its pre-consumed quota. - A local polling timeout or temporary network failure is not itself a failed model task and does not trigger a refund; keep polling within your operational limit.
Video input must be placed in metadata.content with role: "reference_video":
{ "model": "doubao-seedance-2-0-260128", "prompt": "Continue this video naturally", "duration": 4, "metadata": { "resolution": "720P", "content": [{ "type": "video_url", "role": "reference_video", "video_url": {"url": "https://example.com/input.mp4"} }] }}