Download video
GET/v1/videos/{video_id}/contentHEAD
Download a completed task’s video. Usually you can use metadata.url from the task directly; when it points to this endpoint, request it from your server with your API key.
The response is either the video bytes (video/mp4, with Range support) or a 307 redirect to storage. Follow redirects, and do not forward your API key to the redirected host.
Headers
AuthorizationstringRequiredBearer <API_KEY>of the user who owns the task.RangestringOptionalOptional byte range such as
bytes=0-1048575.
Path parameters
video_idstringRequiredThe
idreturned at creation (starts withtask_). Only tasks owned by the key’s user can be read.
Returns
HTTP 200 / 206 with video bytes, or HTTP 307 to a short-lived download URL. Save videos you need to keep in your own storage.
Content-TypeheaderOptionalUsually
video/mp4.
Errors
| HTTP | code | Cause and action |
|---|---|---|
| 400 | invalid_request_error | The task is not completed yet; keep polling the retrieve endpoint. |
| 404 | invalid_request_error | The task does not exist or belongs to another user. |
| 410 | artifact_gone | The video has expired and can no longer be retrieved. |
| 502 | server_error | Storage or the provider is temporarily unavailable; retry later. |
| 401 | — | The API key is invalid, expired or disabled. |
curl -L https://ling-light.com/v1/videos/task_xxxxxxxxxxxxxxxx/content \
-H "Authorization: Bearer $LINGLIGHT_API_KEY" \
-o video.mp4import { writeFile } from 'node:fs/promises'
const response = await fetch('https://ling-light.com/v1/videos/task_xxxxxxxxxxxxxxxx/content', {
headers: {
Authorization: `Bearer ${process.env.LINGLIGHT_API_KEY}`,
},
})
if (!response.ok) throw new Error(`HTTP ${response.status}`)
await writeFile('video.mp4', Buffer.from(await response.arrayBuffer()))import os
import requests
response = requests.get(
"https://ling-light.com/v1/videos/task_xxxxxxxxxxxxxxxx/content",
headers={
"Authorization": f"Bearer {os.environ['LINGLIGHT_API_KEY']}",
},
timeout=300,
)
response.raise_for_status()
with open("video.mp4", "wb") as file:
file.write(response.content)HTTP/1.1 200 OK
Content-Type: video/mp4
<video bytes>Related
API reference overview
Authentication, media URLs, idempotency and errors.
Integration guide
The full flow from API key to downloaded result.