> ## 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 /transcribe
openapi: 3.1.0
info:
  title: AssemblyAI Sync STT API
  description: Synchronous short-form audio transcription using Universal-3.5 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-west-2, us-east-1)
  - url: https://sync.eu.assemblyai.com
    description: EU data residency (eu-north-1)
security:
  - ApiKey: []
paths:
  /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
        120 s.


        <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-5-pro
          description: >-
            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.
        - 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.
                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: 4096
                      description: >-
                        Custom transcription instruction prepended to the
                        model's system prompt. When omitted, a default prompt is
                        applied.
                    keyterms_prompt:
                      type: array
                      items:
                        type: string
                      description: >-
                        Keyterms that bias the decoder toward specific tokens.
                        Maximum 2048 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
                          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). If the number of turns exceeds the context
                        window limit, the oldest turns are dropped first.
                    language_code:
                      default: en
                      description: >-
                        Language of the audio as an ISO 639-1 code, or a list of
                        codes for multilingual audio. Steers the default
                        transcription prompt toward the named language(s).
                        Ignored when a custom `prompt` is set. Defaults to `en`.
                      oneOf:
                        - type: string
                          enum:
                            - en
                            - es
                            - de
                            - fr
                            - it
                            - pt
                            - tr
                            - nl
                            - sv
                            - 'no'
                            - da
                            - fi
                            - hi
                            - vi
                            - ar
                            - he
                            - ja
                            - ur
                            - zh
                        - 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
            encoding:
              audio:
                contentType: audio/wav, audio/pcm
              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
                    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
        '400':
          description: Bad request — audio too short, malformed, or invalid config.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailErrorResponse'
        '413':
          description: Audio exceeds the 120 s duration or 40 MB size limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: Unsupported media type or audio format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded. Retry after `Retry-After` seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailErrorResponse'
        '500':
          description: Internal model error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: >-
            Service unavailable — model cold-starting or concurrency cap
            reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Request exceeded the 30 s per-request deadline.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
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: Word-level timestamps and confidence scores.
        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.
    ErrorResponse:
      type: object
      properties:
        error_code:
          type: string
          description: Machine-readable error code.
          enum:
            - bad_audio
            - audio_too_short
            - audio_too_large
            - bad_request
            - unsupported_media_type
            - capacity_exceeded
            - service_unavailable
            - inference_timeout
            - inference_error
        message:
          type: string
          description: Human-readable error description.
    DetailErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: >-
            Human-readable error description (used for auth and rate-limit
            errors).
    Word:
      type: object
      required:
        - text
        - start
        - end
        - confidence
      properties:
        text:
          type: string
        start:
          type: integer
          description: Word start time in milliseconds.
        end:
          type: integer
          description: Word end time in milliseconds.
        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.

````