Create speech
Synthesizes input and returns the audio. By default the whole file is returned with a
Content-Type matching response_format. With "stream": true the response is raw PCM
(signed 16-bit little-endian, mono, 44.1 kHz) sent as it is generated, typically starting within
100-250 ms. With "stream_format": "sse" the response is text/event-stream carrying
speech.audio.delta events (base64 audio in audio) followed by one speech.audio.done.
Credit is debited up front (input characters). If the speech service fails before sending the
first byte, the credit is returned. input is limited to a deployment-configured maximum
(5,000 characters by default); use async jobs for longer text.
bearerAuthAuthorizationBearer <API key (sk_live_...)>Your secret API key from the dashboard. Keep it on your server.
application/json- body
model?stringModel id. Only sota-voice-v1 exists; may be omitted.
"sota-voice-v1"voice?stringA built-in voice name or the name of one of your cloned voices, in any profile_state. See GET /v1/audio/voices.
"default"input*stringText to synthesize. Characters are billed (NFC code points). At most 5,000 by default.
1 <= lengthresponse_format?stringAudio container for file responses. Ignored for streaming.
"mp3""mp3""wav""opus""aac""flac""pcm"stream?booleanWhen true, returns raw PCM (s16le, mono, 44.1 kHz) as it is generated.
falsestream_format?"sse"Set to sse to receive text/event-stream events instead of raw audio.
"sse"split_granularity?stringHow text is split for generation. sentence splits on sentence ends; clause also splits on commas (more robust, but uses more GPU and makes intonation less fluid); none disables splitting.
"sentence""sentence""clause""none"literal_punctuation?booleanRead punctuation literally instead of treating it as prosody. Passed to the speech service.
The generated audio.
response?BinaryAudioAudio bytes.
binarycurl -X POST 'https://api.example.com/v1/audio/speech' \ -H 'Content-Type: application/json' \ -d '{ "model": "sota-voice-v1", "voice": "zh_1", "input": "你好,欢迎使用 Sota Voice。", "response_format": "mp3"}'"<binary MP3 data>"