> ## 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/dictation.yaml GET /warm
openapi: 3.1.0
info:
  title: AssemblyAI Dictation API
  description: >-
    Short-form dictation that returns send-ready cleaned-up text together with
    the verbatim transcript, in a single HTTP call.
  version: 1.0.0
servers:
  - url: https://dictation.assemblyai.com
    description: Global (default — routes to nearest region)
  - url: https://dictation.us.assemblyai.com
    description: US data residency (us-east-1, us-east-2, us-west-1, us-west-2)
  - url: https://dictation.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:
  /warm:
    get:
      summary: Pre-warm a connection
      description: >
        Establish the HTTPS connection (DNS resolution, TCP handshake and TLS

        handshake) ahead of a `/v1/transcribe/live` or `/v1/transcribe`

        request, so the dictation request starts uploading audio immediately

        instead of paying for connection setup first. This lowers the latency

        the user sees.


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

        user reaches for the record button. The warmed connection is reused only

        when the transcription request goes through the same HTTP client

        (connection pool) and the same base URL, and idle connections are

        evicted after a short window, so warm shortly before recording rather

        than at startup. The endpoint is unauthenticated, idempotent and safe to

        call repeatedly. See [Connection
        pre-warming](/dictation/connection-pre-warming)

        for how it works and when to call it.
      operationId: warmDictation
      responses:
        '200':
          description: >-
            The connection is open and pooled by your HTTP client. The body
            carries no information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  warm:
                    type: string
                    example: toasty
      security: []
      x-codeSamples:
        - lang: python
          label: Python SDK
          source: |
            import assemblyai as aai

            aai.settings.api_key = "<YOUR_API_KEY>"

            with aai.DictationTranscriber() as transcriber:
                # Call as soon as you know audio is coming (e.g. the user reaches for record).
                transcriber.warm()

                # Same transcriber -> reuses the warmed connection; no handshake here.
                result = transcriber.transcribe_live("clip.wav")
                print(result.final_text)
        - lang: javascript
          label: JavaScript SDK
          source: >
            import { AssemblyAI } from "assemblyai";


            const client = new AssemblyAI({ apiKey: "<YOUR_API_KEY>" });


            // Call as soon as you know audio is coming (e.g. the user reaches
            for record).

            await client.dictation.warm();


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

            const result = await client.dictation.transcribeLive("./clip.wav");

            console.log(result.final_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://dictation.assemblyai.com/warm \
              --next \
              -X POST https://dictation.assemblyai.com/v1/transcribe/live \
              -H 'Authorization: <YOUR_API_KEY>' \
              -F 'audio=@clip.wav;type=audio/wav'
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your AssemblyAI API key, sent as the raw key with no `Bearer` prefix. A
        missing header or an invalid key returns `401`.

````