Skip to main content
The SDK throws two error types, and retries transient failures automatically. Both apply identically to 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 a Retry-After header when present.
Transcription uploads audio as an octet-stream rather than multipart, which keeps the request body replayable — so 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 an AbortSignal:
A user-triggered abort() propagates as-is (it is not retried or wrapped). A client-side timeout surfaces as a GekoConnectionError with timedOut === true.
Double-billing on a retried timeout. A tts.create() or stt.transcribe() call that times out client-side is retried by default. In the rare case the original request had already succeeded server-side, you could be billed twice. If you need strict once-only semantics, set maxRetries: 0 and handle retries yourself.

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.