Synthesise speech (voice preview)

Renders text with the given voice and returns the audio inline as base64, plus its duration and — when available — word/marker timings.

This is the editor's "listen" action, so it has editor-shaped side effects: the result is written into the slide audio cache for videoId/slideId when those are supplied, the workspace pronunciation dictionary is applied, and a VoiceCall accounting record is written.

Long-text and premium-voice permission both depend on the plan. Synthesis always uses the workspace of your token: a custom voice is checked against that workspace and you, so one narrowed to other workspaces or users is rejected as no longer available. A custom voice narrowed to some users also plays for a teammate through a videoId of a video in the workspace that speaks with it and whose owner may use it.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

The audio comes back as a base64-encoded string of an mp3, 160 kbps, 24 kHz, mono file — not a
URL and not a binary body. Decode data and write it to a file.

duration is exact rather than an estimate. markers (word boundaries) appears only when the
provider returns them and is omitted entirely when empty, so do not rely on it without testing the
provider you plan to use. For length alone, get-speech-duration
answers without synthesising anything and without a voice-call charge.

curl -X PATCH 'https://apis.elai.io/api/v1/voices' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "Welcome to the product tour.",
  "voice": "en-US-JennyNeural",
  "provider": "azure",
  "language": "English"
}'
Body Params
string
required

Speech text. May contain SSML-ish markup handled by the provider.

string
required

Voice id. Must exist in the voices map for language, or be a custom voice the workspace owns.

string
enum
required

TTS provider. Any other value is rejected.

Allowed:
string
required

Language name as used by the voices map, e.g. English.

string

When set, seeds generation deterministically and lets the result populate the audio cache.

string | integer

Slide the audio belongs to, for the audio cache.

string

Honoured for platform staff only; every other caller is served as their token's workspace.

string

A VoiceCustomization _id (legacy field name) whose settings and model are applied.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json