Voice & Lip-sync
Generate speech from text, clone voices from audio samples, and lip-sync videos to new speech.
The Voice & Lip-sync API has three tools: text to speech, voice cloning and lip-sync. Each one starts work in the background and returns straight away, so you start it, poll it, then fetch the result.
Text to speech
Text to speech works in sessions. A session holds speech cards; each card is one piece of text, its language and the voice that speaks it. You choose the IDs of sessions and cards yourself (UUIDs), so you can save and generate without waiting for the server to hand you an ID.
Pick a voice
Use a voice from the voice catalog (List voices in the Video Dubbing API: its provider and providerVoiceId), or a voice you cloned (see below). The voice must support the language of the card.
Save the cards
Call Save a session with a new sessionId and the list of cards. Each card has its own id, name, text (up to 5,000 characters), language and voice. Saving is free. Keep the revision from the response.
Generate each card
Call Generate speech once per card, with its cardId, text, targetLanguage, provider and voiceId. Credits are charged at this point. You get status: processing back straight away.
Collect the audio
Poll Get a session every few seconds until the card in clips is done; its outputUrl plays the audio. To download, call Get session download URLs, or file the clips in your assets with Save a session to assets.
Saving again
Send the whole list of cards on every save, in reading order, with the revision from your last read or save as baseRevision. If the session changed in the meantime (for example a teammate edited it in the Universe app), the save is refused with 409 and the body carries the current session: apply your change to it and save again. Cards you leave out are deleted only when you send baseRevision.
Changing the text, language or voice of a card that is done clears its audio; generate it again to get new audio (charged again). playbackRate and volume do not change the audio itself: they are applied when the clip is saved to assets.
Card statuses
status | Meaning |
|---|---|
draft | Saved, not generated yet (or its audio was cleared by an edit). |
processing | Generating. |
done | Ready. outputUrl plays the audio. |
failed | Generation failed. The credits were refunded. Generate it again. |
cancelled | Stopped before it finished. |
Voice cloning
Clone
Call Clone a voice with multipart/form-data: a name, the provider (elevenlabs or cartesia) and 1 to 5 audio files in samples (up to 100 MB each). Audio already in your assets can be used with sampleAssetIds instead. The response is 202 with the voice processing.
Wait until it is ready
Poll Get a cloned voice until status is ready. If it is failed, the credits are refunded and you can retry it.
Use it
In a speech card and in Generate speech, set provider to the voice's provider and voiceId to its providerVoiceId.
List cloned voices also returns voices shared from other organizations in your group (ownedByOrg: false). You can use those, but only the organization that cloned a voice can retry or delete it.
Lip-sync
Pick a model and check the price
List lip-sync models returns the models your organization can use (available: true). Each model has its own price per minute. Price a lip-sync tells you what a given length costs, and your balance.
Start the job
Call Start a lip-sync with multipart/form-data: the video (up to 1000 MB), the new audio (up to 100 MB), a name, the language key of the audio and, if you like, a model. Files in your assets can be used with videoAssetId and audioAssetId. The server measures the audio (else the video) and charges for that length before the job starts.
Wait for the video
Poll Get a lip-sync job until status is done. A render can take many minutes; every 10 to 30 seconds is enough.
Collect the video
Get a download link with Get a lip-sync download URL, or file it in your assets with Save a lip-sync to assets. Not happy with it? Re-run a lip-sync renders it again (charged again); the current video is kept until the new one succeeds.
status | Meaning |
|---|---|
processing | Rendering. |
done | Ready to download. |
failed | The render failed; error says why. The credits were refunded. |
cancelled | Deleted while rendering. The credits were kept. |
The process history
List processes is one paginated list of every text-to-speech session, voice clone and lip-sync job, with its clips. Use the clip id from it with Get a process, Get a process download URL and Rename a process.
Links expire
outputUrl, videoUrl, audioUrl and previewUrl are for playback and expire after about 15 minutes; read the job again for fresh ones. The download routes return links of their own, and each download is recorded in your organization's audit log.
Permissions
Each endpoint page lists the permission it needs. The API key needs them on the role of the person who created it.
| Resource | Covers | Actions used |
|---|---|---|
playground.tts | Text-to-speech sessions: save, generate, read, download and delete them. | create, read, update, export, delete |
playground.voice_clone | Clone voices, retry clones, read and delete cloned voices. | create, read, delete |
playground.lip_sync | Start, re-run, read, download and delete lip-sync jobs; list the models. | create, read, export, delete |
playground.video_process | The shared process history: read, download, rename and delete single clips. | read, export, update, delete |
Credits
Generating speech, cloning a voice and starting or re-running a lip-sync are charged when they start. Without enough credits they return 402 and nothing starts. Speech and lip-sync are charged per second and adjusted to the real length when the work is done; a failure on our side is refunded in full; deleting work that is still running keeps the charge. Current prices are on Generate speech, Clone a voice and Start a lip-sync. See Credits.