Overview
Send an audio file in a single HTTP request, get a transcript back in milliseconds. No polling, no session management.- Python
- JavaScript
- cURL
When to use Sync STTSync STT is ideal for pre-recorded audio clips under 2 minutes where you need
an immediate response without polling — for example, voice message transcription,
short call recordings, or voice agent pipelines that handle turn detection
externally and submit completed utterances for transcription. For audio longer
than 120 seconds, use Pre-recorded STT.
For live microphone audio, use Real-time STT.
Before you begin
To complete this guide, you need:- An AssemblyAI API key — get one by signing up at assemblyai.com
- An audio file in WAV format (or raw PCM S16LE)
- Python 3.8+, Node.js 18+, or cURL
Step 1: Configure your API key
Browse to API Keys in your dashboard and copy your API key.- Python
- JavaScript
- cURL
Step 2: Send the audio file
The Sync API acceptsmultipart/form-data with an audio part. For WAV files, set the part’s Content-Type to audio/wav. The X-AAI-Model: universal-3-5-pro header is required on every request.
- Python
- JavaScript
- cURL
Install the Send the audio file:
requests library if you haven’t already:Sending raw PCM audioIf your audio is raw PCM (S16LE little-endian), set the part Content-Type to
audio/pcm and include sample_rate and channels in a config part.
See Sending raw PCM audio below for a full example.Step 3: Parse the response
A successful request returns a JSON object with the transcript and word-level details:| Field | Description |
|---|---|
text | Full transcript of the audio. |
words | Word-level timestamps (start, end, in milliseconds) and per-word confidence. |
confidence | Overall transcript confidence score (0–1). |
audio_duration_ms | Duration of the submitted audio in milliseconds. |
session_id | Server-generated UUID. Include this when contacting support. |
- Python
- JavaScript
- cURL
Sending raw PCM audio
When your audio is raw PCM (S16LE little-endian), set theaudio part Content-Type to audio/pcm and include sample_rate and channels in the config part:
- Python
- JavaScript
- cURL
Next steps
- Prompting and keyterms — improve accuracy with custom prompts and keyterm biasing
- Conversation context — pass prior dialogue for multi-turn continuity
- Language selection — transcribe in any of the 19 supported languages
- Audio requirements — duration, size, and format constraints
- Error handling — status codes and retry guidance
- Cloud endpoints & data residency — use the EU endpoint for data residency
- API reference — full endpoint documentation
Need help?
If you get stuck, contact our support team at support@assemblyai.com or create a support ticket. Include thesession_id from the response to help us look up your request.