Quickstart
Get started with VoxRouter.
VoxRouter is one API for text-to-speech across every major provider. It is OpenAI-compatible, so any OpenAI client works against it with a base URL change. For VoxRouter-aware code, use the first-party SDK — the import line is where provider-specific features land (catalog typing, attribution headers, future routing hints).
The TypeScript SDK is live. Python, Go, and Rust follow the same pattern (types auto-generated from the OpenAPI spec, hand-written branded client) and ship on demand.
Generate speech (curl)
POST /v1/audio/speech with an input string and a voice. The response body is the raw audio — mp3 by default.
curl https://api.voxrouter.ai/v1/audio/speech \
-H "Authorization: Bearer $VOXROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "elevenlabs/eleven_turbo_v2_5",
"voice": "EXAVITQu4vr4xnSDxMaL",
"input": "Hello from VoxRouter.",
"response_format": "mp3"
}' \
--output hello.mp3Generate speech (fetch)
Same call from the browser or Node. The response body is a Blob you can play, save, or stream.
const resp = await fetch("https://api.voxrouter.ai/v1/audio/speech", {
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "elevenlabs/eleven_turbo_v2_5",
voice: "EXAVITQu4vr4xnSDxMaL",
input: "Hello from VoxRouter.",
response_format: "mp3",
}),
});
const audio = new Audio(URL.createObjectURL(await resp.blob()));
audio.play();List voices
GET /v1/voices returns the catalog for a configured provider. Filter by provider, language, or gender.
curl "https://api.voxrouter.ai/v1/voices?provider=elevenlabs" \
-H "Authorization: Bearer $VOXROUTER_API_KEY"OpenAI-compatible fallback
The OpenAI SDK works unchanged against VoxRouter — point its base URL at https://api.voxrouter.ai/v1 and pass your VoxRouter key. The first-party SDK is still the primary path for VoxRouter-aware code.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.voxrouter.ai/v1",
apiKey: process.env.VOXROUTER_API_KEY!,
});
const mp3 = await client.audio.speech.create({
model: "elevenlabs/eleven_turbo_v2_5",
voice: "EXAVITQu4vr4xnSDxMaL",
input: "Hello from VoxRouter.",
});Current scope
- TTS only. Full voice-agents routing returns later.
- Alpha — endpoints and response shapes may still change.
- Keep API keys out of source control; inject at runtime.