Getting Started with the Async Text-to-Speech Streaming API#
Welcome! This quick-start guide walks you through sending your first request and turning text into real-time audio.Prerequisites#
Developer account on Async A command-line HTTP client (examples use cURL; feel free to use Postman, Python requests, etc.)
ffmpeg (optional, but handy for converting the raw stream to other formats for playback)
Get Your API Key#
1.
Log in to the Async dashbaord.
2.
Navigate to API Keys → Create API Key.
3.
Copy the key and store it securely (it starts with sk_).
4.
You can export it as an environment variable so it never appears in your shell history:
Make Your First Request#
Here’s a simple curl
command that sends text and receives streamed audio in response:Playing or Converting the Stream#
The command above stores 44.1 kHz 16-bit mono PCM samples in speech.pcm.Quick playback (macOS/Linux)Tip: For real-time playback, pipe the cURL output directly into ffplay:Handling Errors#
HTTP Code | Meaning | Most common fixes |
---|
401 Unauthorized | Bad or missing X-Api-Key | Check key spelling; confirm it has TTS scope. |
429 Too Many Requests | You hit the rate limit. | Wait for the mentioned time and retry (or upgrade plan). |
400 Bad Request | Validation error in your JSON. | Validate JSON, field names, and ranges. |
| | |
Need help? Ping us or hop into our developer Discord. Happy building!Modified at 2025-05-26 13:41:44