Create your first video task in 10 minutes
Run this integration on a server. Store the API key in an environment variable or secrets manager, never in a browser, mobile bundle, or public repository.
Prepare the environment
- Create an accountSign in and create a model API key for server-side use.
- Set environment variablesConfigure VIDEO_API_BASE and VIDEO_API_KEY without committing the key.
- List modelsCall GET /v1/models and select an available model ID.
- Submit a taskCall POST /v1/videos and record the public task ID.
export VIDEO_API_BASE="https://ling-light.com"
export VIDEO_API_KEY="sk-your-api-key"List models for the current key
curl "$VIDEO_API_BASE/v1/models" \
--header "Authorization: Bearer $VIDEO_API_KEY"Create a video task
curl --request POST "https://ling-light.com/v1/videos" \
--header "Authorization: Bearer $VIDEO_API_KEY" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: $(uuidgen)" \
--data '{
"model": "seedance2.0",
"prompt": "An orange cat watching rain from a windowsill, slow camera push-in",
"seconds": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}'Poll until a terminal state
curl "$VIDEO_API_BASE/v1/videos/<TASK_ID>" \
--header "Authorization: Bearer $VIDEO_API_KEY" \
--header "Accept: application/json"Poll every 3 to 5 seconds. When completed, read metadata.url. When failed, record the error and stop polling.
Do not replace the idempotency key after a timeout
After a timeout, disconnect, or 5xx response, keep the original Idempotency-Key and query the task or contact support. A new key can create a duplicate task and charge.
Complete Node.js example
Copy a server-side create-and-poll example.
Errors and task states
Review HTTP statuses and retry guidance.