Skip to main content
POST
/
transcribe
Transcribe a short audio file
curl --request POST \
  --url https://sync.assemblyai.com/transcribe \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-AAI-Model: <x-aai-model>' \
  --form audio='@example-file' \
  --form 'config={
  "prompt": "<string>",
  "keyterms_prompt": [
    "<string>"
  ],
  "conversation_context": "<string>",
  "language_code": "en"
}'
import requests

url = "https://sync.assemblyai.com/transcribe"

files = { "audio": ("example-file", open("example-file", "rb")) }
payload = { "config": "{
\"prompt\": \"<string>\",
\"keyterms_prompt\": [
\"<string>\"
],
\"conversation_context\": \"<string>\",
\"language_code\": \"en\"
}" }
headers = {
"X-AAI-Model": "<x-aai-model>",
"Authorization": "<api-key>"
}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.text)
const form = new FormData();
form.append('audio', '<string>');
form.append('config', '{
"prompt": "<string>",
"keyterms_prompt": [
"<string>"
],
"conversation_context": "<string>",
"language_code": "en"
}');

const options = {
method: 'POST',
headers: {'X-AAI-Model': '<x-aai-model>', Authorization: '<api-key>'}
};

options.body = form;

fetch('https://sync.assemblyai.com/transcribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://sync.assemblyai.com/transcribe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n{\r\n \"prompt\": \"<string>\",\r\n \"keyterms_prompt\": [\r\n \"<string>\"\r\n ],\r\n \"conversation_context\": \"<string>\",\r\n \"language_code\": \"en\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data",
"X-AAI-Model: <x-aai-model>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://sync.assemblyai.com/transcribe"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n{\r\n \"prompt\": \"<string>\",\r\n \"keyterms_prompt\": [\r\n \"<string>\"\r\n ],\r\n \"conversation_context\": \"<string>\",\r\n \"language_code\": \"en\"\r\n}\r\n-----011000010111000001101001--")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-AAI-Model", "<x-aai-model>")
req.Header.Add("Authorization", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://sync.assemblyai.com/transcribe")
.header("X-AAI-Model", "<x-aai-model>")
.header("Authorization", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n{\r\n \"prompt\": \"<string>\",\r\n \"keyterms_prompt\": [\r\n \"<string>\"\r\n ],\r\n \"conversation_context\": \"<string>\",\r\n \"language_code\": \"en\"\r\n}\r\n-----011000010111000001101001--")
.asString();
require 'uri'
require 'net/http'

url = URI("https://sync.assemblyai.com/transcribe")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-AAI-Model"] = '<x-aai-model>'
request["Authorization"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n{\r\n \"prompt\": \"<string>\",\r\n \"keyterms_prompt\": [\r\n \"<string>\"\r\n ],\r\n \"conversation_context\": \"<string>\",\r\n \"language_code\": \"en\"\r\n}\r\n-----011000010111000001101001--"

response = http.request(request)
puts response.read_body
{
  "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"
}
{
"message": "<string>"
}
{
"detail": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"detail": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}

Authorizations

Authorization
string
header
required

Your AssemblyAI API key. Optionally prefixed with Bearer. Also accepted as the token query parameter.

Headers

X-AAI-Model
enum<string>
required

Model identifier used for request routing. The canonical value is universal-3-5-pro; u3-sync-pro and u3-pro are accepted as legacy aliases.

Available options:
universal-3-5-pro

Query Parameters

token
string

API key alternative for clients that cannot set the Authorization header. The header wins when both are present.

Body

multipart/form-data
audio
file
required

Raw audio bytes. Set the part's Content-Type to audio/wav for WAV files or audio/pcm for raw S16LE little-endian PCM.

config
object

Optional transcription configuration.

Response

Transcription completed successfully.

text
string
required

Full transcript of the audio.

words
object[]
required

Word-level timestamps and confidence scores.

confidence
number<float>
required

Overall transcript confidence (0–1).

audio_duration_ms
integer
required

Duration of the submitted audio in milliseconds.

session_id
string<uuid>
required

Server-generated request identifier. Include this in support requests.