Skip to main content
QUICKSTART

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.

Last updated

Prepare the environment

  1. Create an accountSign in and create a model API key for server-side use.
  2. Set environment variablesConfigure VIDEO_API_BASE and VIDEO_API_KEY without committing the key.
  3. List modelsCall GET /v1/models and select an available model ID.
  4. Submit a taskCall POST /v1/videos and record the public task ID.
Environment variablesbash
export VIDEO_API_BASE="https://ling-light.com"
export VIDEO_API_KEY="sk-your-api-key"

List models for the current key

bashbash
curl "$VIDEO_API_BASE/v1/models" \
  --header "Authorization: Bearer $VIDEO_API_KEY"

Create a video task

bashbash
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

bashbash
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.

Complete Node.js example
Copy a server-side create-and-poll example.
Errors and task states
Review HTTP statuses and retry guidance.