AsyncFlow API
  1. Text-to-Speech
AsyncFlow API
  • Welcome to AsyncFlow API
  • Get Started
  • API Reference
    • API Status
      • API Status Check
    • Text-to-Speech
      • Text to Speech (Stream)
        POST
    • Voice Management
      • Clone Voice
      • List Voices
      • Get Voice
      • Update Voice
      • Delete Voice
      • Get Voice Preview
  1. Text-to-Speech

Text to Speech (Stream)

POST
https://api.async.ai/text_to_speech/streaming
Text to Speech in streaming mode
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.async.ai/text_to_speech/streaming' \
--header 'x-api-key: <api-key>' \
--header 'version: v1' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model_id": "asyncflow_v2.0",
    "transcript": "Hello, world!",
    "voice": {
        "mode": "id",
        "id": "e0f39dc4-f691-4e78-bba5-5c636692cc04"
    },
    "output_format": {
        "container": "raw",
        "encoding": "pcm_f32le",
        "sample_rate": 44100
    }
}'
Response Response Example
200 - Success
This endpoint returns an octet stream of the audio.

Request

Header Params
x-api-key
string 
required
Example:
<api-key>
version
string 
required
Example:
v1
Body Params application/json
model_id
enum<string> 
required
Model id
Allowed value:
asyncflow_v2.0
transcript
string 
required
Text to convert to the speech
voice
object 
required
Voice to use while make speech
mode
enum<string> 
required
Allowed value:
id
id
string 
required
Voice id
output_format
object 
required
Output configurations
container
enum<string> 
required
Output audio format
Allowed values:
rawmp3
encoding
enum<string> 
required
Output audio encoding
Allowed values:
pcm_f32lepcm_s16le
sample_rate
integer 
required
Output audio sample rate
>= 8000<= 48000
bit_rate
integer 
optional
Output audio bit rate. Use only with mp3
>= 32000<= 320000
Default:
192000
string 
required
Examples

Responses

🟢200Success
application/octet-stream
If quota is exceeded during the stream the following bytes would be received: b"--ERROR:QUOTA_EXCEEDED--"
Body
object {0}
🟠429TOO_MANY_CONCURRENT_REQUESTS
🟠429RATE_LIMIT_EXCEEDED
🟠429USAGE_LIMIT_EXCEEDED
🟠401INVALID_API_KEY
🟠404VOICE_NOT_FOUND
🟠404VERSION_NOT_FOUND
🟠400INVALID_LANGUAGE
🟠400FORMAT_NOT_RECOGNIZED
🔴500Server Error
Modified at 2025-06-26 10:43:43
Previous
API Status Check
Next
Clone Voice
Built with