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. accountId may be supplied to synthesise using another workspace's dictionary and voice allowances, as long as that workspace is in your own organization; anything outside it is rejected with 403.

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

Synthesise using this workspace's dictionary and allowances instead of the caller's.

string

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

Responses

accountId belongs to a workspace outside your organization.

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