POST
/audio/voicesCreate a custom voice
Creates a custom voice for audio output from an audio sample and a previously uploaded consent recording. Send name, audio_sample, and consent as multipart form data; type defaults to audio_sample when omitted. Custom voices are limited to eligible customers.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Multipart form data for creating a custom voice from an audio sample and consent recording.
typestringoptional
The voice creation method. Defaults to `audio_sample` when omitted.
namestringrequired
The name of the new voice.
audio_samplestringrequired
The sample audio recording file. Maximum size is 10 MiB.
Supported MIME types:
`audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`, `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`.
consentstringrequired
The consent recording ID (for example, `cons_1234`).
200Returns the created voice object with its identifier, name, creation timestamp, and creation type.
objectstringrequired
The object type, which is always `audio.voice`.
idstringrequired
The voice identifier, which can be referenced in API endpoints.
typestringrequired
How the voice was created.
namestringrequired
The name of the voice.
created_atintegerrequired
The Unix timestamp (in seconds) for when the voice was created.
400Returned when the voice request, consent recording, or audio sample is invalid.
errorobjectrequired
404Returned when the endpoint is unavailable or the consent recording was not found.
errorobjectrequired
500Returned when the audio sample could not be processed or the voice could not be created.
errorobjectrequired
Error handling
A 400 is returned when the voice request, consent recording, or audio sample is invalid. A 404 is returned when the endpoint is unavailable or the consent recording cannot be found. A 500 is returned when the sample cannot be processed or the voice cannot be created. name, audio_sample, and consent are required; name must be 1 to 256 characters, and type must be audio_sample.