Skip to main content

Overview

Send an audio file in a single HTTP request, get a transcript back in milliseconds. No polling, no session management.
import requests

with open("sample.wav", "rb") as f:
    audio = f.read()

response = requests.post(
    "https://sync.assemblyai.com/transcribe",
    headers={
        "Authorization": "<YOUR_API_KEY>",
        "X-AAI-Model": "universal-3-5-pro",
    },
    files={
        "audio": ("sample.wav", audio, "audio/wav"),
    },
    timeout=60,
)
response.raise_for_status()
result = response.json()
print(result["text"])
The Sync API uses our flagship Universal-3.5 Pro model and accepts audio from 80 milliseconds up to 120 seconds. It transcribes with state-of-the-art accuracy in 19 languages.
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.
YOUR_API_KEY = "<YOUR_API_KEY>"

Step 2: Send the audio file

The Sync API accepts multipart/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.
Install the requests library if you haven’t already:
pip install requests
Send the audio file:
import requests

with open("sample.wav", "rb") as f:
    audio = f.read()

response = requests.post(
    "https://sync.assemblyai.com/transcribe",
    headers={
        "Authorization": "<YOUR_API_KEY>",
        "X-AAI-Model": "universal-3-5-pro",
    },
    files={
        "audio": ("sample.wav", audio, "audio/wav"),
    },
    timeout=60,
)
response.raise_for_status()
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:
{
  "text": "Hi, I'm calling about my Best Buy order...",
  "words": [
    { "text": "Hi",  "start": 0,   "end": 200, "confidence": 0.91 },
    { "text": "I'm", "start": 220, "end": 320, "confidence": 0.88 }
  ],
  "confidence": 0.87,
  "audio_duration_ms": 101567,
  "session_id": "eb92c4ff-4bbb-429f-9b99-7279d7fe738f"
}
FieldDescription
textFull transcript of the audio.
wordsWord-level timestamps (start, end, in milliseconds) and per-word confidence.
confidenceOverall transcript confidence score (0–1).
audio_duration_msDuration of the submitted audio in milliseconds.
session_idServer-generated UUID. Include this when contacting support.
result = response.json()
print(result["text"])
print(result["session_id"])

Sending raw PCM audio

When your audio is raw PCM (S16LE little-endian), set the audio part Content-Type to audio/pcm and include sample_rate and channels in the config part:
import json
import requests

with open("sample.pcm", "rb") as f:
    audio = f.read()

response = requests.post(
    "https://sync.assemblyai.com/transcribe",
    headers={
        "Authorization": "<YOUR_API_KEY>",
        "X-AAI-Model": "universal-3-5-pro",
    },
    files={
        "audio": ("sample.pcm", audio, "audio/pcm"),
        "config": (
            None,
            json.dumps({"sample_rate": 16000, "channels": 1}),
            "application/json",
        ),
    },
    timeout=60,
)
response.raise_for_status()
print(response.json()["text"])

Next steps

Need help?

If you get stuck, contact our support team at support@assemblyai.com or create a support ticket. Include the session_id from the response to help us look up your request.