Docs/Official SDKs
Official SDKs.
Maintained by us, kept feature-flat with the REST and WebSocket APIs, every release pushed within a week of the underlying change.
Python
Synchronous and async clients. Streaming via aiohttp; works inside FastAPI, Django Channels, and plain scripts.
bash
pip install celestlabs
python
from celestlabs import CelestLabs client = CelestLabs() # reads CELESTLABS_API_KEY from env # one-shot audio = client.speech.create(voice="meera", input="Hello, world.") # streaming with client.realtime.connect(voice="arjun") as session: session.send_text("Streaming voice in real time.") for chunk in session.audio_chunks(): speaker.write(chunk)
Node.js / TypeScript
bash
npm i @celestlabs/sdk
javascript
import { CelestLabs } from "@celestlabs/sdk"; const client = new CelestLabs(); // reads CELESTLABS_API_KEY const audio = await client.speech.create({ voice: "meera", input: "Hello, world.", }); // streaming with an async iterator for await (const chunk of client.realtime.stream({ voice: "arjun", input: "Real time." })) { speaker.write(chunk); }
Go
bash
go get github.com/celestlabs/celestlabs-go
Ruby
bash
gem install celestlabs
cURL recipes
Useful for shell scripts, CI, and quick sanity checks.
bash
# Save synthesised WAV curl -sS https://api.celestlabs.ai/v1/audio/speech \ -H "Authorization: Bearer $CELESTLABS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"voice":"meera","input":"Hello."}' \ --output hello.wav # Pipe directly into ffplay for instant playback curl -sS https://api.celestlabs.ai/v1/audio/speech \ -H "Authorization: Bearer $CELESTLABS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"voice":"saanvi","input":"Hello.","format":"mp3"}' \ | ffplay -nodisp -autoexit -
OpenAI SDK works too
If you'd rather not add another dependency, the openai SDK with base_url swapped to ours covers the REST surface. See OpenAI compatibility.