POST
/
v1
/
text-to-voice
/
create-previews

Pricing

When you hit generate, the model will create three voice previews and charge credits equal to the input prompt text length (100-1000 characters).

Follow our Voice Design Prompt Guide for best results.

Headers

xi-api-key
string

Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.

Query Parameters

output_format
enum<string>
default: mp3_44100_192

Output format of the generated audio. Must be one of: mp3_22050_32 - output format, mp3 with 22.05kHz sample rate at 32kbps. mp3_44100_32 - output format, mp3 with 44.1kHz sample rate at 32kbps. mp3_44100_64 - output format, mp3 with 44.1kHz sample rate at 64kbps. mp3_44100_96 - output format, mp3 with 44.1kHz sample rate at 96kbps. mp3_44100_128 - default output format, mp3 with 44.1kHz sample rate at 128kbps. mp3_44100_192 - output format, mp3 with 44.1kHz sample rate at 192kbps. Requires you to be subscribed to Creator tier or above. pcm_16000 - PCM format (S16LE) with 16kHz sample rate. pcm_22050 - PCM format (S16LE) with 22.05kHz sample rate. pcm_24000 - PCM format (S16LE) with 24kHz sample rate. pcm_44100 - PCM format (S16LE) with 44.1kHz sample rate. Requires you to be subscribed to Pro tier or above. ulaw_8000 - μ-law format (sometimes written mu-law, often approximated as u-law) with 8kHz sample rate. Note that this format is commonly used for Twilio audio inputs.

Available options:
mp3_22050_32,
mp3_44100_32,
mp3_44100_64,
mp3_44100_96,
mp3_44100_128,
mp3_44100_192,
pcm_16000,
pcm_22050,
pcm_24000,
pcm_44100,
ulaw_8000

Body

application/json
voice_description
string
required

Description to use for the created voice.

Required string length: 20 - 1000
text
string
required

Text to generate, text length has to be between 100 and 1000.

Required string length: 100 - 1000
auto_generate_text
boolean
default: false

Whether to automatically generate a text suitable for the voice description.

Response

200 - application/json
previews
object[]
required
text
string
required