Skip to main content
@gekoai/sdk is a thin, typed client for the Geko API. Zero runtime dependencies (built on the global fetch), dual ESM + CommonJS, bundled type declarations. Runs on Node 20+, Deno, Bun, and browsers (via a server-side proxy).

Install

The client

The client is namespaced by service. Text-to-speech lives under geko.tts; platform-level calls (models, health) sit on the client. Future services (speech-to-text, …) will appear as sibling namespaces — see the roadmap.

Options

new Geko(options?)

geko.tts.create(params)

Synthesize speech. Returns a Promise<ArrayBuffer> of raw WAV bytes (24 kHz, PCM16, mono).
Turn the bytes into a file or a playable blob — see Playing & saving audio.

geko.tts.stream(params)

Stream synthesis sentence-by-sentence to start playback sooner on long text. Returns an async iterable of WAV ArrayBuffers — one per chunk, each independently playable. Same params as create().
Streams aren’t retried (a partial stream can’t be replayed); use signal to cancel and a per-call timeout to bound the whole stream. Under the hood it consumes the framed wav-frames-v1 protocol from POST /v1/tts/stream.

geko.tts.voices(model?, options?)

List the voices for a model. Returns { model, voices: Voice[] }.

geko.models(options?)

List every model on the platform and its voices. Returns { data: Model[] }.

geko.health(options?)

Service probe. Returns { status, models: string[] }.
The read methods accept an options object of { signal?, timeout? }.

Types

Response types describe the server contract; like most thin SDKs, JSON bodies are not re-validated at runtime.

Timeouts, cancellation & retries

Covered in depth in Errors & retries. In short: transient failures (network, timeout, 5xx) retry with backoff; 429 never does; pass an AbortSignal or a per-call timeout to control individual requests.

Bring your own fetch

Useful for proxies, logging, or tests. The SDK always calls fetch as a free function, so undici’s global keeps its binding and your custom fetch keeps its own.

Next steps

Playing & saving audio

Turn the WAV bytes into files, playback, or other formats.

Errors & retries

Typed errors, automatic retries, timeouts, and cancellation.

Latency & quality

Tune the nfe dial and understand cold starts.

CLI

Synthesize and browse the catalog from your terminal.