Get a video job
Read a video job's status, progress, cost and, once completed, a fresh one-hour link to the file.
MarkdownOn this page
/v1/videos/{id}Returns the job. Read it every few seconds until status is completed, failed or cancelled. Each read signs a new link to the file, so an expired output.url is fixed by reading the job again.
Example
curl https://api.getlykia.com/v1/videos/gen-1795463406-qOWSYdRnX7cEsv8q \
-H "Authorization: Bearer $LYKIA_API_KEY"import os
import requests
VIDEO_ID = "gen-1795463406-qOWSYdRnX7cEsv8q"
response = requests.get(
f"https://api.getlykia.com/v1/videos/{VIDEO_ID}",
headers={"Authorization": f"Bearer {os.environ['LYKIA_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
job = response.json()
print(job["status"], job["progress"])
if job["status"] == "completed":
print(job["output"]["url"], "valid until", job["output"]["expires_at"])const VIDEO_ID = "gen-1795463406-qOWSYdRnX7cEsv8q";
const response = await fetch(`https://api.getlykia.com/v1/videos/${VIDEO_ID}`, {
headers: { Authorization: `Bearer ${process.env.LYKIA_API_KEY}` },
});
if (!response.ok) throw new Error(`Lykia returned ${response.status}: ${await response.text()}`);
const job = (await response.json()) as { status: string; progress: number; output?: { url: string | null; expires_at?: string } };
console.log(job.status, job.progress);
if (job.status === "completed") console.log(job.output?.url, "valid until", job.output?.expires_at);{
"id": "gen-1795463406-qOWSYdRnX7cEsv8q",
"object": "video",
"status": "completed",
"progress": 100,
"model": "bytedance/seedance-1.0-pro",
"provider": "bytedance",
"created_at": 1795463406,
"completed_at": 1795463439,
"expires_at": 1796068239,
"duration_seconds": 5,
"params": {
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p",
"image": false,
"last_frame": false,
"reference_images": 0
},
"usage": {
"cost": 0.2574,
"is_byok": false,
"cost_details": {
"upstream_cost": 0.2574,
"platform_fee": 0,
"is_byok": false
}
},
"output": {
"url": "https://files.example.com/media/gen-1795463406-qOWSYdRnX7cEsv8q/0.mp4?X-Amz-Expires=3600&X-Amz-Signature=5f0c9e…",
"expires_at": "2026-11-23T20:50:41.145Z",
"mime_type": "video/mp4",
"bytes": 310368
}
}The job object
idstringThe job id; also the id of its request record (GET /generation).
objectstringAlways video.
statusstringqueued, in_progress, completed, failed or cancelled.
progressinteger0 to 100, when the provider reports it.
modelstringThe model; with a preset, the real model.
providerstringThe provider running the job.
created_at, completed_at (integer | null) — Unix times.
expires_atinteger | nullWhen Lykia deletes the file (Unix time). The time is set by the platform.
duration_secondsnumber | nullThe video's length, once completed.
paramsobjectA summary of the request: duration, aspect_ratio, resolution, audio when given, and image, last_frame, reference_images as whether or how many were sent.
errorobjectOnly on failed and cancelled jobs: message, code (such as timeout), reason and, when the provider charged for its rejection, billed_by_provider: true.
usageobjectOnce the job has ended: cost in USD, is_byok and cost_details. A failed or cancelled job costs 0 unless the provider charged for it.
outputobjectOnce completed: url (signed, valid for one hour), expires_at (when the link stops working), mime_type, bytes, and width and height when known. If Lykia's storage is not available, url is null and content gives the path of GET /videos/{id}/content, which streams the file instead.
A cancelled job:
{
"id": "gen-1795463449-mbcwAk5o21bdfuKi",
"object": "video",
"status": "cancelled",
"progress": 0,
"model": "bytedance/seedance-1.0-pro",
"provider": "bytedance",
"created_at": 1795463449,
"completed_at": 1795463449,
"expires_at": null,
"duration_seconds": null,
"params": {
"duration": 5,
"image": false,
"last_frame": false,
"reference_images": 0
},
"error": {
"message": "The job was cancelled",
"code": "cancelled",
"reason": "invalid_request"
},
"usage": {
"cost": 0,
"is_byok": false,
"cost_details": {
"upstream_cost": 0,
"platform_fee": 0,
"is_byok": false
}
}
}Errors
404 when the job does not exist or belongs to another project.