SDKs
SDKs
First-party Python and Node packages are in progress and not published yet. Until they are, there are two ways to call the API that work today — and neither needs a dependency.
Nothing to install yet. If you have seen pip install vocalix or npm i vocalix referenced elsewhere, those packages are not on PyPI or npm at the time of writing. Use one of the options below and swap later — the wire format will not change.
1 · The OpenAI SDK, pointed at us
If you already depend on openai, this is the shortest path: change the base URL and keep your code. Full mapping →
2 · Plain HTTP
One POST, one file. There is nothing an SDK would be hiding.
import { writeFile } from "node:fs/promises"; const res = await fetch("https://api.vocalix.ai/v1/tts", { method: "POST", headers: { Authorization: `Bearer ${process.env.VOCALIX_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ text: "Namaste", voice_id: "meera-hi", model: "echo-1", }), }); if (!res.ok) throw new Error((await res.json()).code); await writeFile("reply.wav", Buffer.from(await res.arrayBuffer()));
Error handling is the one place an SDK would earn its keep, and it is three lines: every failure is problem+json with a stable code. The full list →