1. Speech-to-Text
Voice API
  • Welcome to Async Voice API
  • Getting Started with the Async Voice API
  • Models
  • Billing & Pricing
  • 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)
    • Speech-to-Text
      • Speech to Text (WebSocket)
      • Speech to Text
        POST
    • Voice Management
      • Clone Voice
      • List Voices
      • Get Voice
      • Get Voices (Batch)
      • Update Voice
      • Delete Voice
      • Get Voice Preview
  • Advanced Guides
    • Embed Player
    • Custom Pronunciations
      • Embedding Custom Phonemes in Async Voice API
      • Pronouncing digits one‑by‑one
      • Insert Silent Pauses with <break>
  • Integrations
    • Integrate with Twilio
    • Pipecat Integration
    • Livekit Integration
  1. Speech-to-Text

Speech to Text (WebSocket)

wss://api.async.com/speech_to_text/stream
Real-time speech-to-text over WebSocket. Send audio chunks as you record and receive interim transcripts as the speech is recognized.

Connection#

wss://api.async.com/speech_to_text/stream?api_key=sk_your_token&model_id=async_asr_v1.0
Query Parameters:
ParameterRequiredDescription
api_keyYesYour API key (sk_...)
model_idNoModel to use. Default: async_asr_v1.0
languageNoLanguage hint (ISO 639-1 code)
πŸ’‘ See Speech to Text for detailed parameter descriptions.

Audio Format#

Send audio as PCM16, 16 kHz, mono β€” either:
Binary frames: raw PCM16 bytes (preferred for performance)
JSON frames: {"audio": "<base64-encoded PCM16 chunk>"}
Send chunks of approximately 0.25–0.5 seconds (4000–8000 bytes at 16 kHz PCM16).

Signaling End of Audio#

When you're done sending audio, send a text frame:
{"final": true}
This tells the server to finalize the transcript and close the stream.

Server Messages#

The server sends JSON text frames:

Interim result (partial transcript)#

{
  "type": "interim",
  "text": "Hello how are you doing",
  "delta": "doing"
}
text β€” cumulative transcript so far (replace your UI text with this)
delta β€” only the new piece since the last message (append to your UI)
Use whichever field fits your UI pattern.

Final result#

{
  "type": "done",
  "text": "Hello, how are you doing today?"
}
Sent after receiving {"final": true}. Contains the finalized, punctuated transcript.

Error#

{
  "type": "error",
  "error": "Description of what went wrong"
}

Examples#

Python#

JavaScript (Browser β€” live microphone)#

Notes#

Send audio continuously as it's captured β€” don't wait for silence.
The server sends interim messages as it recognizes speech. These are cumulative (the text field always contains the full transcript so far).
After you send {"final": true}, the server responds with a done message containing the finalized transcript, then closes the connection.
Cold start: the first connection after idle may take 60–150s. Keep the connection open during a session to avoid repeated cold starts.

Request

Query Params

Modified atΒ 2026-07-06 11:35:23
Previous
Text to Speech (Stream)
Next
Speech to Text
Built with