POST /voice/synthesize— Convert text to speechPOST /voice/clone— Clone a voice from an audio sample
Synthesize speech
EndpointRequest parameters
string
required
The text you want to convert to speech. There is no strict character limit, but longer inputs take more time to process and consume more of your plan’s quota.
string
The identifier of the voice to use for synthesis. If omitted, the API uses the default voice for the specified language.
string
The BCP-47 language code for the output speech — for example,
"en", "fr", or "de". Defaults to "en". The voice you select must support the language you specify.float
A multiplier that controls how fast the speech is delivered. Accepts a value between
0.5 (half speed) and 2.0 (double speed). Defaults to 1.0 (normal speed).Example request
synthesize-voice.sh
Example response
response.json
Response fields
string
A unique identifier for this voice synthesis request.
string
The CDN URL for the generated MP3 audio file. Use this URL to download or stream the audio in your application.
float
The total playback duration of the generated audio file, in seconds.
string
An ISO 8601 timestamp indicating when the audio file was generated.
Audio files are available for 24 hours after generation. Download and store them in your own storage if you need long-term access.
Clone a voice
Create a custom cloned voice from an audio sample. Once cloned, the voice receives a uniquevoice_id that you can pass to POST /voice/synthesize to generate speech in that voice.
Endpoint
Request parameters
string
required
A display name for the cloned voice — for example,
"My Brand Voice". Used to identify the voice in your account.string
required
A publicly accessible URL pointing to an audio file (MP3 or WAV) to use as the voice sample. For best results, provide a clean recording of at least 30 seconds with minimal background noise.
Example request
clone-voice.sh
Example response
clone-response.json
Response fields
string
The unique identifier for the cloned voice. Pass this value as
voice_id in a POST /voice/synthesize request to use this voice for speech synthesis.string
The display name you assigned to the cloned voice.
string
The processing status of the clone. The voice becomes available for synthesis once the status is
"ready". Possible values are "processing" and "ready".string
An ISO 8601 timestamp indicating when the cloning request was submitted.
Error responses
400 Bad Request — Missing or invalid parameters
400 Bad Request — Missing or invalid parameters
Returned when the
text field is missing from a synthesize request, the speed value is outside the accepted range, or a required field is absent from a clone request.400-response.json
429 Too Many Requests — Rate limited
429 Too Many Requests — Rate limited
Returned when you have exceeded your plan’s rate limit. Wait the number of seconds indicated in the
Retry-After header before retrying.429-response.json