tts.* and stt.* — same credentials, same retry policy, two hosts.
Error types
GekoError
The API responded with a non-2xx status. Carries the HTTP status and the server’s detail message.
GekoConnectionError
Extends GekoError (with status === 0). The request never reached the server — a network failure or a client-side timeout. Check timedOut and cause.
TypeError
Thrown before any request for argument mistakes the SDK can catch locally — stt.transcribe() with both audio and url (or neither), empty audio, or a negative estimateCredits() duration. These aren’t API errors and never count against your balance.
Status codes
429 applies to both products at once — it’s one balance, so synthesis and transcription stop together.
Automatic retries
On transient failures the SDK retries with exponential backoff + jitter (default 2 retries), honoring aRetry-After header when present.
stt.transcribe() gets the same retry-on-5xx behavior as everything else.
tts.stream() is the one exception: a partially consumed stream can’t be replayed, so streams are never retried. Bound them with a per-call timeout and cancel with an AbortSignal.
Timeouts & cancellation
The default timeout is 120 s (generous, because a scaled-to-zero GPU can cold-start slowly). Override per client or per call, and cancel with anAbortSignal:
abort() propagates as-is (it is not retried or wrapped). A client-side timeout surfaces as a GekoConnectionError with timedOut === true.
Next steps
Authentication
Fix a 401 by creating or rotating a key.
Limits & constraints
Request limits, formats, and cold starts.
Billing & credits
Why 429 means out of credits, and how to top up.
FAQ & troubleshooting
Common status codes and quick fixes.