> ## 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.

# Pre-warm a connection



## OpenAPI

````yaml specs/sync-api.yaml GET /warm
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:
  /warm:
    get:
      summary: Pre-warm a connection
      description: >
        Establish the HTTPS connection — DNS resolution, TCP handshake, and TLS

        handshake — ahead of a `/transcribe` request, so the transcription

        request starts uploading audio immediately instead of paying for

        connection setup first.


        Call it as soon as you know audio is coming (typically the moment

        recording starts). The warmed connection is reused only when the

        `/transcribe` request goes through the same HTTP client (connection

        pool) and the same base URL, and idle connections are evicted after a

        few seconds to minutes — so warm right before transcribing, not at

        startup. The endpoint is unauthenticated, idempotent, and safe to call

        repeatedly. See [Connection
        pre-warming](/sync-stt/connection-pre-warming)

        for how it works and when to call it.
      operationId: warmSync
      parameters:
        - in: header
          name: X-AAI-Model
          required: true
          schema:
            type: string
            enum:
              - universal-3-5-pro
          description: >-
            Model identifier used for request routing. Use the same value as
            your `/transcribe` request so the warmed connection matches the path
            the transcription will take.
      responses:
        '200':
          description: >-
            Connection established. The response body carries no information —
            the value of the call is the open connection left in your client's
            pool.
          content:
            application/json:
              schema:
                type: object
                properties:
                  warm:
                    type: string
              example:
                warm: toasty
      security: []
      x-codeSamples:
        - lang: python
          label: Python
          source: |
            import requests

            session = requests.Session()

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

            # Same session -> reuses the warmed connection; no handshake here.
            with open("sample.wav", "rb") as f:
                response = session.post(
                    "https://sync.assemblyai.com/transcribe",
                    headers={
                        "Authorization": "<YOUR_API_KEY>",
                        "X-AAI-Model": "universal-3-5-pro",
                    },
                    files={"audio": ("sample.wav", f, "audio/wav")},
                    timeout=60,
                )
            print(response.json()["text"])
        - lang: javascript
          label: JavaScript
          source: >
            // Call as soon as you know audio is coming (e.g. recording starts).

            // Node's fetch keeps the connection alive in its pool by default.

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


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

            const form = new FormData();

            form.append("audio", audioBlob, "sample.wav");

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

            console.log((await response.json()).text);
        - lang: bash
          label: cURL
          source: |
            # curl opens a fresh connection per process, so chain both
            # requests in one invocation with --next to share the connection:
            curl https://sync.assemblyai.com/warm \
              -H 'X-AAI-Model: universal-3-5-pro' \
              --next \
              -X POST https://sync.assemblyai.com/transcribe \
              -H 'Authorization: <YOUR_API_KEY>' \
              -H 'X-AAI-Model: universal-3-5-pro' \
              -F 'audio=@sample.wav;type=audio/wav'
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your AssemblyAI API key. Optionally prefixed with `Bearer `. Also
        accepted as the `token` query parameter.

````