generate_talking_avatar
Creates a talking avatar video: generates a portrait from your description, converts text to speech, and lip-syncs the face. Preview cost first, then confirm to render.
Instructions
Make a short video of a PORTRAIT speaking the user's text (a "talking avatar"). The server generates a front-facing portrait from your description, turns the text into speech (ElevenLabs TTS, auto-detects language incl. Russian), and lip-syncs the face to it. ASYNC — returns a job_id; the caller MUST poll check_job until status="completed" (lip-sync is SLOW — HD/OmniHuman can take several minutes; the fast tier ~1-2 min). Returns a hosted MP4 URL on completion. TWO-STEP FLOW (confirmation REQUIRED — this reserves tokens): STEP 1 (preview) call WITHOUT confirmed → returns the estimated cost (portrait + voice + lip-sync), submits nothing, reserves nothing. Show the cost, ask the user. STEP 2 (submit) call again with confirmed=true → generates the portrait, reserves tokens, and starts the render; returns the job_id. Cost typically 600-2500 tokens depending on tier + text length.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The EXACT words the avatar should SAY, read verbatim (no stage directions). Up to ~500 chars (~30s of speech). | |
| tier | No | "quality" = OmniHuman, HD + most realistic, slower (default). "fast" = SadTalker, simpler 256p but ~1-2 min. | |
| style | No | Optional portrait style, e.g. "photo" (default, realistic), "cinema", "3d", "anime". | |
| voice | No | Voice. A preset: Aria, Sarah, Charlotte, Matilda (female) or Roger, George, Charlie, Brian (male) — default Aria. OR the user's OWN cloned voice: pass its name (cloned voices are made in the avots app / Telegram). The cost-only preview (confirmed=false) lists the user's available cloned voice names. If a saved `avatar` has a default voice and this is omitted, that default is used. | |
| avatar | No | OPTIONAL — reuse a SAVED avatar (its exact stored face) instead of generating a new one. Pass the avatar's name OR id (see list_avatars; the confirmed=false preview also lists them under `avatars`). When set, the saved portrait is used directly (best lip-sync, identical face every time) and `portrait_prompt` is ignored. If the avatar has a default voice and you do not pass `voice`, that default is used. Provide EITHER `avatar` OR `portrait_prompt`. | |
| confirmed | No | Must be true to actually submit + reserve tokens. Omit/false for a cost-only preview. | |
| portrait_prompt | No | What the avatar LOOKS like — a front-facing person. e.g. "a young woman with brown hair and blue eyes, warm smile". Describe a real human face (the lip-sync needs one). Required UNLESS `avatar` is given. Note: a fresh face is generated each call, so the look will vary slightly between videos; use `avatar` for a consistent recurring character. |