Skip to main content

Text to Speech Request

curl --location 'https://api.znapai.com/v1/audio/speech' \
--header 'Authorization: Bearer $ZnapAI_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "model": "gpt-4o-mini-tts",
    "input": "Today is a wonderful day to build something people love!",
    "voice": "coral",
    "instructions": "Speak in a cheerful and positive tone."
  }'

Reponse

Image

Parameters

model
string
required
Name of the model to use. Must be a suitable deployed audio model.Allowed values:
  • tts-1
input
string
required
The text to generate audio for. Maximum length is 4096 characters.
voice
string
required
The voice to generate the audio in. Allowed values include coral and other standard OpenAI voices.
instructions
string
Optional instructions to guide the style or tone of the generated audio.

Params to Avoid

ParamReason
response_formatFormat adjustments are not supported; audio is returned as MP3
speedSpeed adjustments are not supported