Generate a video
A generation renders an identity saying a text you send, to a file: a video (type: "video") or speech alone (type: "audio"). It is an offline job. POST /v1/generations answers 202 at once with the job; the result arrives later, by webhook or by polling GET /v1/generations/{id}. No LiveKit room, no client SDK.
Reach for a generation when the output is a file: pre-rendered clips, batch jobs, anything produced ahead of playback. For a live, two-way conversation, start a session instead.
You need an active identity whose avatar renders on animatron-1. See Create an Identity.
Create a generation
curl -sS -X POST https://api.lookalike.com/v1/generations \
-H "Authorization: Bearer $LOOKALIKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "video",
"identity_id": "id_3f9a2b7c4d1e8a05f6b3",
"text": "Hi! Thanks for signing up. Here is how to get started.",
"video": { "aspect_ratio": "9:16" },
"webhook_url": "https://example.com/hooks/lookalike"
}'
{
"id": "gen_5c1d9e2f7a3b4c6d8e0f",
"object": "generation",
"type": "video",
"status": "pending",
"identity_id": "id_3f9a2b7c4d1e8a05f6b3",
"avatar_id": "avt_1a2b3c4d5e6f7a8b9c0d",
"voice_id": "voc_9f8e7d6c5b4a39281706",
"artifacts": { "video": null, "audio": null },
"usage": { "items": [], "amount_usd": 0 },
"estimated_amount_usd": 0.0333,
"created_at": "2026-11-10T12:00:00Z"
}
| Field | |
|---|---|
type | video or audio. Required. |
identity_id | The identity that speaks. Required. |
text | What it says, 1 to 5000 characters. Required. |
video | For type: "video": resolution (480p, 720p, 1080p) and aspect_ratio (1:1, 9:16, 16:9). Optional. |
webhook_url | An https URL on port 443 that receives the outcome. Optional. Private and internal addresses are refused with 422. |
estimated_amount_usd is what the text's estimated length costs; your balance must cover it, or the request is refused with 402 and nothing is queued. The amount is held until the generation finishes. What you are charged is the length actually produced, in usage.
Errors: 402 the balance does not cover the estimate, 404 no such identity (or not yours), 409 the identity has no face and voice that generations can render.
Get the result
curl -sS https://api.lookalike.com/v1/generations/gen_5c1d9e2f7a3b4c6d8e0f \
-H "Authorization: Bearer $LOOKALIKE_API_KEY"
status moves pending → running → completed, or failed with error: {code, message}, or canceled. A completed generation has asset ids in artifacts.video and artifacts.audio; fetch each with GET /v1/assets/{id}. A failed or canceled generation costs nothing.
When you sent a webhook_url, it receives one POST with a JSON event when the generation finishes:
{ "id": "evt_…", "object": "event", "type": "generation.completed", "created_at": "…", "data": { "id": "gen_…", "status": "completed", "…": "…" } }
The type is generation.completed, generation.failed or generation.canceled. Delivery is attempted once and the event is not signed yet, so treat it as a hint and read the generation with GET before acting on it.
List and cancel
GET /v1/generationslists your generations, newest first. Filters:identity_id,since; paging withcursorandlimit.POST /v1/generations/{id}/cancelcancels apendingorrunninggeneration; nothing is charged. Canceling a canceled generation returns it unchanged; a completed or failed one is409.