GET /warm endpoint takes that setup off the critical path. Call it as soon
as you know audio is coming, typically the moment the user reaches for the
record button, and the connection is established in the background while they
are still getting ready to speak. The transcription request then starts
uploading audio immediately.
How /warm works
GET /warm is an unauthenticated no-op:
- Python SDK
- Python
- JavaScript
warm() returns True once the connection is open and False if it could not
be opened, and never raises. AsyncDictationTranscriber.warm() is the
coroutine equivalent, which pairs well with
asyncio.create_task(transcriber.warm()) so the handshake overlaps whatever
your app is doing next.When to call it
A warmed connection only helps if it is still in the pool when the transcription request goes out, and if that request travels through the same HTTP client and the same host.- Same client. The warm call and the transcription must share a connection
pool. A fresh
requests.Session,httpx.Client, orAssemblyAIinstance for the transcription gets a fresh connection and pays the handshake anyway. - Same host. Pre-warming is per host, so a connection warmed against
dictation.assemblyai.comis no use to a request aimed atdictation.eu.assemblyai.com. Warm the host you are about to call. See Cloud endpoints & data residency. - Not too early. Idle connections are evicted after a short window. In the
Python SDK that window is
settings.keepalive_expiry, which inherits httpx’s 5-second default unless you raise it. Warm shortly before the request rather than at application startup, or raisekeepalive_expiryso one call covers a longer pause.
/warm is idempotent and cheap, so calling it
again to refresh an aging connection is fine.