Video generation API reference
The endpoint follows New API / OpenAI Video conventions. Submit an asynchronous task, poll its status, and read metadata.url after completion.
Connection details
| Item | Value |
|---|---|
| Base URL | https://ling-light.com |
| Authentication | Authorization: Bearer <API_KEY> |
| Request format | application/json |
| Task model | Asynchronous submit, poll, and read |
| Timestamps | Unix seconds |
| Model discovery | GET /v1/models |
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/models | List models available to the API key |
| POST | /v1/videos | Create an asynchronous video task |
| GET | /v1/videos/{id} | Read task status and the video URL |
Create a video task
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | A model ID returned by GET /v1/models |
| prompt | string | Yes | Video generation prompt |
| seconds | integer | No | Video duration in seconds |
| resolution | string | No | For example 480p, 720p, or 1080p |
| aspect_ratio | string | No | For example 16:9, 9:16, 1:1, or auto |
| references | object[] | No | Reference material array |
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"
}'Generation modes
| Mode | references rule |
|---|---|
| Text to video | references is empty or omitted |
| First and last frame | Exactly one first_frame and one last_frame image |
| Reference to video | One or more role=reference image, video, or audio items |
{
"id": "task_xxxxxxxxxxxxxxxx",
"object": "video",
"model": "seedance2.0",
"status": "queued",
"progress": 0,
"created_at": 1793433600,
"seconds": "5",
"metadata": {
"aspect_ratio": "16:9",
"resolution": "720p"
}
}Poll and read the result
Poll every 3 to 5 seconds. completed and failed are terminal. Do not treat progress=100 as success by itself.
{
"id": "task_xxxxxxxxxxxxxxxx",
"object": "video",
"model": "seedance2.0",
"status": "completed",
"progress": 100,
"created_at": 1793433600,
"completed_at": 1793433690,
"seconds": "5",
"metadata": {
"resolution": "720p",
"aspect_ratio": "16:9",
"url": "https://media.example.com/videos/task_xxxxxxxxxxxxxxxx.mp4"
}
}Security and result handling
- Store model API keys only in server-side environment variables or a secrets manager.
- Never place a full key, login session, or console access token in browser requests, source control, or logs.
- metadata.url is an object-storage URL. Download and persist the video promptly.
- Apply your own business review to prompts and reference materials.
The server quote is the billing source of truth
This page does not calculate a final amount from a model ratio. Charges may depend on model, resolution, duration, account group, and server pricing rules.
Next: quickstart
Create an account and API key, then run the first task.
Tasks and errors
Handle polling, terminal states, idempotency, and failures.