Skip to content

Retrieve video

GET/v1/videos/{video_id}

Read a video task’s status and result. Poll every 3–5 seconds with one loop per task; on 429 wait as directed by Retry-After. If your client times out, keep querying the same task instead of creating a new one.

Headers

  • AuthorizationstringRequired

    Bearer <API_KEY>.

Path parameters

  • video_idstringRequired

    The id returned at creation (starts with task_). Only tasks owned by the key’s user can be read.

Returns

HTTP 200 with the video task object, as returned at creation.

  • idstringRequired

    Task ID beginning with task_. Use it to query and download.

  • task_idstringOptional

    Compatibility copy of id.

  • objectstringOptional

    Always video.

  • modelstringOptional

    The requested model ID.

  • statusstringOptional

    Task status. Use status, not progress, to decide completion.

    Supported values

    • queuedWaiting; keep polling
    • in_progressGenerating; keep polling
    • completedDone; read metadata.url
    • failedFailed; read error.message. The charge is refunded by the server
    • unknownStatus not yet known; keep polling the same task and do not resubmit
  • progressintegerOptional

    Progress 0–100, for display only.

  • created_atintegerOptional

    Creation time in Unix seconds.

  • completed_atintegerOptional

    Completion time in Unix seconds; present once completed.

  • secondsstringOptional

    Task duration in seconds, as a string.

  • metadataobjectOptional

    Task parameters and result URL.

    Show child fields (4)
    • resolutionstringOptional

      Resolution tier.

    • aspect_ratiostringOptional

      Aspect ratio.

    • urlstringOptional

      Video URL. Usable only when status is completed. Before that it may already show this site’s /v1/videos/{id}/content URL, which returns 400 until the task finishes.

      Once completed it is either a public storage URL (do not send your API key) or this site’s /v1/videos/{id}/content URL (send the API key that created the task). Use the returned URL as-is.

    • billed_secondsstringOptional

      Billed seconds; returned for some per-second tasks after settlement.

  • errorobjectOptional

    Present only when status is failed.

    Show child fields (2)
    • codestringOptional

      Always video_generation_failed.

    • messagestringOptional

      Failure reason, such as unreadable media or a content policy rejection.

Errors

HTTPcodeCause and action
404invalid_request_errorThe task does not exist or belongs to another user.
401—The API key is invalid, expired or disabled.
403—The key does not allow this model, or the IP is restricted.
429—Polling too fast; wait per Retry-After.
Retrieve a task
curl https://ling-light.com/v1/videos/task_xxxxxxxxxxxxxxxx \
  -H "Authorization: Bearer $LINGLIGHT_API_KEY"
const response = await fetch('https://ling-light.com/v1/videos/task_xxxxxxxxxxxxxxxx', {
  headers: {
    Authorization: `Bearer ${process.env.LINGLIGHT_API_KEY}`,
  },
})
console.log(response.status, await response.json())
import os

import requests

response = requests.get(
    "https://ling-light.com/v1/videos/task_xxxxxxxxxxxxxxxx",
    headers={
        "Authorization": f"Bearer {os.environ['LINGLIGHT_API_KEY']}",
    },
    timeout=60,
)
print(response.status_code, response.json())
Response · completed
{
  "id": "task_xxxxxxxxxxxxxxxx",
  "task_id": "task_xxxxxxxxxxxxxxxx",
  "object": "video",
  "model": "seedance2.0",
  "status": "completed",
  "progress": 100,
  "created_at": 1795660800,
  "completed_at": 1795660950,
  "seconds": "5",
  "metadata": {
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "url": "https://media.example.com/videos/task_xxxxxxxxxxxxxxxx.mp4"
  }
}
Retrieve a task
curl https://ling-light.com/v1/videos/task_xxxxxxxxxxxxxxxx \
  -H "Authorization: Bearer $LINGLIGHT_API_KEY"
const response = await fetch('https://ling-light.com/v1/videos/task_xxxxxxxxxxxxxxxx', {
  headers: {
    Authorization: `Bearer ${process.env.LINGLIGHT_API_KEY}`,
  },
})
console.log(response.status, await response.json())
import os

import requests

response = requests.get(
    "https://ling-light.com/v1/videos/task_xxxxxxxxxxxxxxxx",
    headers={
        "Authorization": f"Bearer {os.environ['LINGLIGHT_API_KEY']}",
    },
    timeout=60,
)
print(response.status_code, response.json())
Response · failed
{
  "id": "task_xxxxxxxxxxxxxxxx",
  "task_id": "task_xxxxxxxxxxxxxxxx",
  "object": "video",
  "model": "seedance2.0",
  "status": "failed",
  "progress": 100,
  "created_at": 1795660800,
  "seconds": "5",
  "metadata": {
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "url": "https://ling-light.com/v1/videos/task_xxxxxxxxxxxxxxxx/content"
  },
  "error": {
    "code": "video_generation_failed",
    "message": "The reference media could not be read. Check that the link is valid and public."
  }
}
API reference overview
Authentication, media URLs, idempotency and errors.
Integration guide
The full flow from API key to downloaded result.
Last updated