BazaarLinkBazaarLink
Sign in
DocsAPI ReferenceSDK ReferenceAgentic UsageAI Skills
Speech synthesis

Speech synthesis

Convert text to audio using an id from /v1/models?output_modalities=speech. Billing uses the model page price per million characters. The complete audio is buffered before returning binary data; incremental streaming is not supported. Routing control fields provider, transforms, route, service_tier, and preset are ignored.

POST/v1/audio/speech

Authorizations

Authorizationrequired
string · header

API key as bearer token in the Authorization header.

Body

modelrequired
string

Model id or alias from /v1/models.

inputrequired
string

Text to synthesize.

1–4096 characters (10,000 for elevenlabs/eleven-v4 and eleven-v4-turbo)
voice
string

Voice supported by the selected model. ElevenLabs models (elevenlabs/*) take one of these voice names (george, sarah, adam, alice, bella, bill, brian, callum, charlie, chris, daniel, eric, harry, jessica, laura, liam, lily, matilda, river, roger, will), or omit it (default george); any other value returns 400 invalid_voice (OpenAI: alloy). Other models require voice. Your own custom voice (voice_…, see Custom voices) also works, once enabled for your account.

response_format
string

Output audio format; support depends on the model. Native WAV routes currently only produce WAV without transcoding; even mp3 or opus requests return audio/wav. Save the file according to the response Content-Type.

mp3opusaacflacwavpcm
speed
number

Speech speed from 0.25 to 4.0; support depends on the model.

0.25–4.0
instructions
string

Speech generation instructions; support depends on the model.

stability
number

Voice stability, 0–1 (default 0.5). Lower is more expressive, higher is more even. Takes effect on elevenlabs/* models when the request is served by our direct voice route; the X-Voice-Settings response header says applied or ignored.

0–1 (0.5)
similarity_boost
number

Similarity to the original voice, 0–1 (default 0.75). Not used by Eleven v3.

0–1 (0.75)
style
number

Style exaggeration, 0–1 (default 0). Above 0 adds latency. Not used by Eleven v4.

0–1 (0)
use_speaker_boost
boolean

Boosts similarity to the original speaker (default true); adds a little latency.

true / false (true)
clone_strength
number

Clone strength, 0–1 (0 is recommended for most voices). Only for your own professional clone voices (voice_…) trained for Eleven v4.

0–1
language_code
string

Two-letter lowercase language code (ISO 639-1) such as ar, ja or en, to fix the spoken language. Not used by multilingual-v2 models.

ISO 639-1, e.g. ar, ja, en
audio_effects
object

Optional audio-effects object: filter_preset_id (e.g. phone, old_radio), environment_id (reverb space, e.g. small_room, hall), background_noise_id (e.g. cafe), distance (0–1), send_level (reverb amount, 0–1) and pan (−1…1). IDs use lowercase letters, digits and underscores; no extra charge. Reverb or a non-zero pan produces stereo audio and cannot be combined with pcm output.

filter_preset_id, environment_id, background_noise_id, distance 0–1, send_level 0–1, pan −1…1

Deep guide →

POST /v1/audio/speech
curl https://api.bazaarlink.ai/v1/audio/speech \
  -H "$BAZAARLINK_AUTH_HEADER" \
  -H "Content-Type: application/json" \
  -d '{"model":"<speech-model-id>","input":"Hello","voice":"alloy","response_format":"mp3"}' \
  --output speech.mp3

# Voice settings (elevenlabs/* models; the X-Voice-Settings response header says applied or ignored)
curl -D - https://api.bazaarlink.ai/v1/audio/speech \
  -H "$BAZAARLINK_AUTH_HEADER" \
  -H "Content-Type: application/json" \
  -d '{"model":"elevenlabs/eleven-v4","input":"Hello","voice":"george","stability":0.4,"similarity_boost":0.8,"style":0.2,"use_speaker_boost":true,"language_code":"en","audio_effects":{"distance":0.3}}' \
  --output speech.mp3
Response examples

Success.

<binary audio>
Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
Speech synthesis — BazaarLink API