> ## Documentation Index
> Fetch the complete documentation index at: https://assemblyai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Transcribe a short audio file



## OpenAPI

````yaml specs/sync-api.yaml POST /v1/transcribe
openapi: 3.1.0
info:
  title: AssemblyAI Sync STT API
  description: Synchronous short-form audio transcription using Universal-3.6 Pro.
  version: 1.0.0
servers:
  - url: https://sync.assemblyai.com
    description: Global (default — routes to nearest region)
  - url: https://sync.us.assemblyai.com
    description: US data residency (us-east-1, us-east-2, us-west-1, us-west-2)
  - url: https://sync.eu.assemblyai.com
    description: >-
      EU data residency (eu-central-1, eu-north-1, eu-south-1, eu-south-2,
      eu-west-1, eu-west-3)
security:
  - ApiKey: []
paths:
  /v1/transcribe:
    post:
      summary: Transcribe a short audio file
      description: >
        Submit an audio file and receive the transcript synchronously in a
        single

        request/response. No polling required. Audio must be between 80 ms and
        20

        minutes, and the file at most 256 MB. The server's deadline for the
        request

        is 30 seconds.


        For audio that is still being recorded, use

        [`/v1/transcribe/live`](/api-reference/sync-api/transcribe-live)
        instead.

        It uploads while the caller records and accepts up to 120 seconds of
        audio.


        <Note>To use a data residency endpoint, replace `sync.assemblyai.com`
        with

        `sync.us.assemblyai.com` (US) or `sync.eu.assemblyai.com` (EU). See

        [Cloud Endpoints and Data Residency](/sync-stt/endpoints-and-data-zones)
        for more information.</Note>
      operationId: transcribeSync
      parameters:
        - in: header
          name: X-AAI-Model
          required: true
          schema:
            type: string
            enum:
              - universal-3-6-pro
              - universal-3-5-pro
          description: >-
            Model identifier used for request routing. Use `universal-3-6-pro`.
            `universal-3-5-pro` is retired: requests that set it, or its legacy
            aliases `u3-sync-pro` and `u3-pro`, are routed to
            `universal-3-6-pro`. See [Speech model versions and
            deprecations](https://www.assemblyai.com/docs/getting-started/model-versions-and-deprecations).
        - in: query
          name: token
          required: false
          schema:
            type: string
          description: >-
            API key alternative for clients that cannot set the `Authorization`
            header. The header wins when both are present.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - audio
              properties:
                audio:
                  type: string
                  format: binary
                  description: >-
                    Raw audio bytes. Set the part's Content-Type to `audio/wav`
                    for WAV files or `audio/pcm` for raw S16LE little-endian
                    PCM. Compressed audio is also accepted: `audio/aac`,
                    `audio/mpeg` (MP3), `audio/mp4` (M4A), `audio/ogg`
                    (Ogg/Opus), `audio/flac`, or `audio/webm`.
                config:
                  type: object
                  description: Optional transcription configuration.
                  properties:
                    sample_rate:
                      type: integer
                      enum:
                        - 8000
                        - 16000
                        - 22050
                        - 24000
                        - 32000
                        - 44100
                        - 48000
                      description: >-
                        Source sample rate in Hz. Required when `audio` is
                        `audio/pcm`. WAV reads the rate from its header.
                    channels:
                      type: integer
                      enum:
                        - 1
                        - 2
                      description: >-
                        Number of audio channels. Required when `audio` is
                        `audio/pcm`. Stereo is down-mixed to mono internally.
                    prompt:
                      type: string
                      maxLength: 6000
                      description: >-
                        Custom transcription instruction prepended to the
                        model's system prompt. When omitted, a default prompt is
                        applied.
                    keyterms_prompt:
                      type: array
                      maxItems: 100
                      items:
                        type: string
                      description: >-
                        Keyterms that bias the decoder toward specific tokens.
                        Maximum 100 terms and 8000 characters total across all
                        terms. Also accepted as `keyterms` or `word_boost` —
                        provide only one of the three.
                    conversation_context:
                      oneOf:
                        - type: string
                        - type: array
                          maxItems: 500
                          items:
                            type: string
                      description: >-
                        Prior turns from the same conversation, in chronological
                        order (oldest first, most recent last). Supplies the
                        preceding dialogue as context so the model transcribes
                        the current clip with greater continuity across a
                        multi-turn conversation (for example, a human speaking
                        with a voice agent). Accepts either a list of turns (for
                        multi-turn conversations) or a single string (treated as
                        one turn). Maximum 500 turns and 16000 characters total
                        — context over either cap is trimmed rather than
                        rejected, oldest turns dropped first, as they are when
                        the prompt exceeds the model's context window.
                    language_codes:
                      description: >-
                        Language of the audio as an ISO language code, or a list
                        of codes for multilingual audio. Steers the default
                        transcription prompt toward the named language(s).
                        Applies alongside a custom `prompt`. When omitted, no
                        language steering is applied. A code outside this set is
                        rejected with a `400` that lists the full set in its
                        `detail`.
                      oneOf:
                        - type: string
                          enum:
                            - en
                            - es
                            - de
                            - fr
                            - it
                            - pt
                            - tr
                            - nl
                            - sv
                            - 'no'
                            - da
                            - fi
                            - hi
                            - vi
                            - ar
                            - he
                            - ja
                            - ur
                            - zh
                            - ko
                            - ca
                            - gl
                            - ru
                            - ro
                            - et
                            - fa
                            - yue
                            - af
                            - mr
                            - zu
                            - xh
                            - nn
                        - type: array
                          items:
                            type: string
                            enum:
                              - en
                              - es
                              - de
                              - fr
                              - it
                              - pt
                              - tr
                              - nl
                              - sv
                              - 'no'
                              - da
                              - fi
                              - hi
                              - vi
                              - ar
                              - he
                              - ja
                              - ur
                              - zh
                              - ko
                              - ca
                              - gl
                              - ru
                              - ro
                              - et
                              - fa
                              - yue
                              - af
                              - mr
                              - zu
                              - xh
                              - nn
                    timestamps:
                      type: boolean
                      default: false
                      description: >-
                        Whether to compute per-word `start`/`end` timestamps.
                        When `false` (default), no timestamps are computed and
                        `start`/`end` are omitted from the `words` objects. When
                        `true`, exact timings are computed for each word, at an
                        additional latency cost. Words that can't be aligned
                        have `start`/`end` omitted rather than estimated.
                        Accuracy is best for English audio.
            encoding:
              audio:
                contentType: >-
                  audio/wav, audio/pcm, audio/aac, audio/mpeg, audio/mp4,
                  audio/ogg, audio/flac, audio/webm
              config:
                contentType: application/json
      responses:
        '200':
          description: Transcription completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncTranscriptResponse'
              example:
                text: Hi, I'm calling about my Best Buy order...
                words:
                  - text: Hi
                    confidence: 0.91
                  - text: I'm
                    confidence: 0.88
                confidence: 0.87
                audio_duration_ms: 101567
                session_id: eb92c4ff-4bbb-429f-9b99-7279d7fe738f
                request_time_ms: 243.7
        '400':
          description: Bad request — audio too short, malformed, or invalid config.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Audio exceeds the 20 minute duration or 256 MB size limit.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: Unsupported media type or audio format.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded. Retry after `Retry-After` seconds.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal model error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: >-
            Service unavailable — model cold-starting or concurrency cap
            reached.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Request exceeded the 30 s per-request deadline.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: python
          label: Python SDK
          source: >
            import os


            from assemblyai.sync.v1 import SyncTranscriber,
            SyncTranscriptionConfig


            config = SyncTranscriptionConfig(model="universal-3-6-pro")

            transcriber =
            SyncTranscriber(api_key=os.environ["ASSEMBLYAI_API_KEY"],
            config=config)


            transcriber.warm()  # open the connection ahead of the request

            result = transcriber.transcribe("./sample.wav")

            print(result.text)
        - lang: javascript
          label: JavaScript SDK
          source: >
            import { AssemblyAI } from "assemblyai";


            // Create the client once and reuse it for every request.

            const client = new AssemblyAI({ apiKey:
            process.env.ASSEMBLYAI_API_KEY });


            // Call warm() as soon as you know audio is coming (e.g. recording

            // starts), not right before transcribe.

            await client.sync.warm();


            // Same client -> reuses the warmed connection; no handshake here.

            const result = await client.sync.transcribe("./sample.wav", {
              model: "universal-3-6-pro",
            });

            console.log(result.text);
        - lang: bash
          label: cURL
          source: >
            # curl opens a fresh connection per process, so chain the warm-up
            and

            # the transcription in one invocation with --next to share the
            connection:

            curl https://sync.assemblyai.com/v1/warm \
              -H 'X-AAI-Model: universal-3-6-pro' \
              --next \
              -X POST https://sync.assemblyai.com/v1/transcribe \
              -H 'Authorization: <YOUR_API_KEY>' \
              -H 'X-AAI-Model: universal-3-6-pro' \
              -F 'audio=@sample.wav;type=audio/wav'
        - lang: python
          label: Python
          source: |
            import requests

            # Create the Session once and reuse it for every request.
            session = requests.Session()

            # Call /warm as soon as you know audio is coming (e.g. recording
            # starts), not right before transcribe.
            session.get(
                "https://sync.assemblyai.com/v1/warm",
                headers={"X-AAI-Model": "universal-3-6-pro"},
                timeout=10,
            )

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

            # Same session -> reuses the warmed connection; no handshake here.
            response = session.post(
                "https://sync.assemblyai.com/v1/transcribe",
                headers={
                    "Authorization": "<YOUR_API_KEY>",
                    "X-AAI-Model": "universal-3-6-pro",
                },
                files={"audio": ("sample.wav", audio, "audio/wav")},
                timeout=60,
            )
            response.raise_for_status()
            print(response.json()["text"])
        - lang: javascript
          label: JavaScript
          source: >
            import { readFileSync } from "fs";


            // Call /warm as soon as you know audio is coming (e.g. recording

            // starts), not right before transcribe. Node's fetch pools the

            // connection by default.

            await fetch("https://sync.assemblyai.com/v1/warm", {
              headers: { "X-AAI-Model": "universal-3-6-pro" },
            });


            const audio = readFileSync("sample.wav");

            const form = new FormData();

            form.append("audio", new Blob([audio], { type: "audio/wav" }),
            "sample.wav");


            // Same process -> reuses the warmed connection; no handshake here.

            const response = await
            fetch("https://sync.assemblyai.com/v1/transcribe", {
              method: "POST",
              headers: {
                Authorization: "<YOUR_API_KEY>",
                "X-AAI-Model": "universal-3-6-pro",
              },
              body: form,
            });


            const result = await response.json();

            console.log(result.text);
components:
  schemas:
    SyncTranscriptResponse:
      type: object
      required:
        - text
        - words
        - confidence
        - audio_duration_ms
        - session_id
      properties:
        text:
          type: string
          description: Full transcript of the audio.
        words:
          type: array
          items:
            $ref: '#/components/schemas/Word'
          description: >-
            Per-word confidence scores, plus `start`/`end` timestamps when the
            request sets `timestamps` to `true`.
        confidence:
          type: number
          format: float
          description: Overall transcript confidence (0–1).
        audio_duration_ms:
          type: integer
          description: Duration of the submitted audio in milliseconds.
        session_id:
          type: string
          format: uuid
          description: >-
            Server-generated request identifier. Include this in support
            requests.
        request_time_ms:
          type: number
          format: float
          description: >-
            End-to-end server-side processing time for the request in
            milliseconds, covering queue wait, decoding, and inference.
    ErrorResponse:
      type: object
      description: >-
        RFC 9457 problem details, returned with Content-Type
        `application/problem+json` for every error.
      properties:
        status:
          type: integer
          description: The HTTP status code.
        title:
          type: string
          description: >-
            Stable identity of the error, such as `Bad Audio`, `Audio Too
            Short`, `Bad Request`, `Unauthorized`, `Audio Too Large`,
            `Unsupported Media Type`, `Too Many Requests`, `Capacity Exceeded`,
            `Service Unavailable`, `Inference Timeout`, or `Inference Error`.
            The SDKs expose it in snake case as the error code
            (`audio_too_large`).
        detail:
          type: string
          description: Human-readable explanation of this occurrence.
    Word:
      type: object
      required:
        - text
        - confidence
      properties:
        text:
          type: string
        start:
          type: integer
          description: >-
            Word start time in milliseconds. Present only when the request sets
            `timestamps` to `true` and the word could be aligned; omitted
            otherwise.
        end:
          type: integer
          description: >-
            Word end time in milliseconds. Present only when the request sets
            `timestamps` to `true` and the word could be aligned; omitted
            otherwise.
        confidence:
          type: number
          format: float
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your AssemblyAI API key. Optionally prefixed with `Bearer `. Also
        accepted as the `token` query parameter.

````