Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.supertoneapi.com/llms.txt

Use this file to discover all available pages before exploring further.

The Supertone API ships with two officially supported SDKs. They wrap the REST API with idiomatic clients, handle streaming and long text for you, and stay in sync with the OpenAPI specification.

Python SDK

pip install supertone — sync and async clients, parallel auto-chunking.

TypeScript SDK

npm add @supertone/supertone — promise-based, ESM/CJS, Node and Bun.

Package summary

PythonTypeScript
Packagesupertone on PyPI@supertone/supertone on npm
Reposupertone-inc/supertone-pythonsupertone-inc/supertone-ts
LanguagesPython 3.9+TypeScript 5+ / Node 18+
Module formatsESM + CommonJS
AuthSupertone(api_key=...)new Supertone({ apiKey: ... })
Sync APIYes (default)n/a
Async API*_async methods + async withAll methods (Promises)
Streamingiter_bytes() / aiter_bytes()ReadableStream reader
Auto-chunk long text✅ (300 chars, parallel up to 3 workers)✅ (300 chars, sequential)
Custom retries✅ via retry_config✅ via retryConfig
HTTP backendhttpxfetch

What the SDKs do for you

  • Authentication — pass your API key once at construction; every request gets the right header.
  • Type-safe enums for languages, models, and output formats.
  • Streaming — iterate audio chunks idiomatically (Python generators, TS ReadableStream).
  • Long-text auto-chunking — both SDKs split inputs at 300 characters, run TTS per chunk, and merge the audio. The streaming variants forward chunks transparently, so consumers don’t need to know that the underlying request was split.
  • Errors — typed exception/error classes keyed to HTTP status codes (UnauthorizedErrorResponse, TooManyRequestsErrorResponse, etc.).
  • Retry policy — configurable retries with backoff for transient 5xx and 429 responses.

When to use the REST API directly

The REST API is available for languages and runtimes where an SDK isn’t published — Go, Java, PHP, Rust, embedded systems — or when you want maximum control over the wire format. The endpoints are documented in the API Reference; examples in that section include curl, JavaScript, Go, Python, PHP, and Java. If you call REST directly, you’ll need to implement chunking, retries, and streaming consumption yourself.

Next

Python SDK

Install, authenticate, and run your first call.

TypeScript SDK

Install, authenticate, and run your first call.