Create a video
Start a video generation job from a prompt, a first frame, a last frame or reference images. Returns the job right away.
MarkdownOn this page
/v1/videosStarts a video job and returns the job object at once with status: "queued". Follow it with GET /videos/{id} and download the file with GET /videos/{id}/content. Walkthrough: Video generation.
Request body
modelstringrequiredA video model id (for example bytedance/seedance-1.0-pro) or a preset such as @video. List video models with GET /models?kind=video.
promptstringrequiredWhat should happen in the video.
imagestringA first frame: a public https:// URL or a data URI.
last_framestringA last frame, together with image, on models with lastFrame.
reference_imagesstring[]Up to 32 reference images, as the model allows.
durationnumberLength in seconds, within the model's durations. duration_seconds and seconds are read too.
aspect_ratiostringFrom the model's aspectRatios.
resolutionstringFrom the model's resolutions.
audiobooleanSound on or off, for models where it can be chosen.
seedintegerOn models that support it.
provider_optionsobjectProvider-specific options from the model's allow-list.
models, provider, user, metadata — As in POST /images/generations.
Example
curl https://api.getlykia.com/v1/videos \
-H "Authorization: Bearer $LYKIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bytedance/seedance-1.0-pro",
"prompt": "Waves rolling onto a quiet beach at dusk, slow camera pan",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}'import os
import requests
response = requests.post(
"https://api.getlykia.com/v1/videos",
headers={"Authorization": f"Bearer {os.environ['LYKIA_API_KEY']}"},
json={
"model": "bytedance/seedance-1.0-pro",
"prompt": "Waves rolling onto a quiet beach at dusk, slow camera pan",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
},
timeout=60,
)
response.raise_for_status()
job = response.json()
print(job["id"], job["status"]) # keep the id: it is how you follow the jobconst response = await fetch("https://api.getlykia.com/v1/videos", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.LYKIA_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
model: "bytedance/seedance-1.0-pro",
prompt: "Waves rolling onto a quiet beach at dusk, slow camera pan",
duration: 5,
resolution: "720p",
aspect_ratio: "16:9",
}),
});
if (!response.ok) throw new Error(`Lykia returned ${response.status}: ${await response.text()}`);
const job = (await response.json()) as { id: string; status: string };
console.log(job.id, job.status); // keep the id: it is how you follow the job{
"id": "gen-1795463406-qOWSYdRnX7cEsv8q",
"object": "video",
"status": "queued",
"progress": 0,
"model": "bytedance/seedance-1.0-pro",
"provider": "bytedance",
"created_at": 1795463406,
"completed_at": null,
"expires_at": null,
"duration_seconds": null,
"params": {
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p",
"image": false,
"last_frame": false,
"reference_images": 0
}
}The job object is described under GET /videos/{id}. params summarises what you asked for; image inputs show only whether they were given.
Errors
| Status | Code | When |
|---|---|---|
400 | unsupported_input | An unsupported value (metadata.param), or an option combination that is not priced yet. |
400 | unsupported_model | The model does not make videos. |
402 | insufficient_credits | The balance, key limit or project budget cannot cover the job's reservation. |
403 | platform_sales_disabled | The provider is not offered on Lykia credits yet; add your own key for it. |
403 | byok_only_no_key | The project only allows its own provider keys and has none for this model. |
429 | media_queue_full | The project already has the most jobs Lykia lets it keep waiting. |
For example, a duration outside the model's range:
{
"error": {
"message": "duration must be between 2 and 12 seconds for seedance-1-0-pro-250528",
"type": "invalid_request_error",
"code": "unsupported_input",
"status": 400,
"metadata": {
"reason": "unsupported_input",
"param": "duration"
}
}
}