AsyncFlow API
    AsyncFlow API
    • Welcome to AsyncFlow API
    • Get Started
    • API Reference
      • API Status
        • API Status Check
      • Text-to-Speech
        • Text to Speech (WebSocket)
        • Text to Speech
        • Text to Speech with Word Timestamps
        • Text to Speech (Stream)
      • Voice Management
        • Clone Voice
        • List Voices
        • Get Voice
        • Update Voice
        • Delete Voice
        • Get Voice Preview
    • Integrations
      • Integrate with Twilio

    Get Started

    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
    API key
    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)
    Convert to WAV
    Tip: For real-time playback, pipe the cURL output directly into ffplay:

    Handling Errors#

    HTTP CodeMeaningMost common fixes
    401 UnauthorizedBad or missing X-Api-KeyCheck key spelling; confirm it has TTS scope.
    429 Too Many RequestsYou hit the rate limit.Wait for the mentioned time and retry (or upgrade plan).
    400 Bad RequestValidation 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
    Previous
    Welcome to AsyncFlow API
    Next
    API Status Check
    Built with