OptionalreadFor stream(): milliseconds a read of the body may wait for audio,
30 000 by default; 0 turns it off. Only the time a read spends waiting
counts, so playback at its own pace never trips it. A body that stalls
without being reset (a dropped NAT mapping, a hung proxy) then ends with
the same retryable TextToSpeechError as a cut, and the connection is
released.
Optionalsignal?: AbortSignalAn external abort signal, combined with the timeout. Aborting it rejects
the request with the signal's reason; for stream() it also stops the
download of the body, and the iteration throws that reason. One signal
can serve many requests: each detaches from it when it ends.
Optionaltimeout?: numberMilliseconds until the request is aborted with a DOMException named
TimeoutError. For synthesize() the whole request, 610 000 by default
(the response waits for the complete audio; the API caps a request at
600 seconds). For stream() the wait for the headers and first audio,
30 000 by default; each later read of the body is bounded by
readTimeout instead.
On Node, the built-in fetch also gives up after 300 seconds without
response headers (undici's headersTimeout), so a synthesize() longer
than that fails with a TypeError first. For longer requests use
stream(), or raise that limit with
setGlobalDispatcher(new Agent({ headersTimeout: 610_000 })) from the
undici package.
Per-request options of the HTTP client.