Quickstart.
From signup to first synthesized audio in under 60 seconds.
1. Get an API key
Sign in with Google, then go to API Keys in your dashboard and create a new key. The full key is shown only once at creation — copy it somewhere safe before closing the dialog.
Go to dashboard2. Synthesize speech
Pass your key as a Bearer token. The response body is a 24 kHz mono WAV (audio/wav) — write it straight to a file.
curl https://silk-api.rumik.ai/v1/tts \
-H "Authorization: Bearer rk_live_•••••••••" \
-H "Content-Type: application/json" \
-d '{ "model": "muga", "text": "Hello, world." }' \
--output speech.wavOptional fields: description (voice description, e.g. "deep male voice, slightly raspy"), temperature, top_p, max_new_tokens.
3. Stream the response
For real-time playback, mint a one-shot WebSocket session and connect to it. The server streams raw PCM int16 little-endian @ 24 kHz mono as binary frames, then sends a terminal {"type":"done"} JSON text frame.
// 1. Mint a session token (one-shot, short TTL)
const r = await fetch("https://silk-api.rumik.ai/v1/tts/ws-connect", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SILK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ model: "muga", text: "Voice that ships in milliseconds." }),
});
const { ws_url, ws_token } = await r.json();
// 2. Connect to the WebSocket and consume PCM frames
const ws = new WebSocket(`${ws_url}?token=${ws_token}`);
ws.binaryType = "arraybuffer";
ws.onmessage = (e) => {
if (e.data instanceof ArrayBuffer) {
const pcm = new Int16Array(e.data); // 24kHz mono — feed to AudioWorklet
// ...
} else {
const event = JSON.parse(e.data);
if (event.type === "done") ws.close();
}
};Errors and rate limits
All errors return JSON of shape { errorCode, message }. Rate limits are enforced per API key; the response includes a Retry-After header when applicable.
| Status | Meaning |
|---|---|
| 400 | Malformed request body |
| 401 | Bearer token missing, invalid, or expired |
| 403 | Key revoked or account disabled |
| 422 | Validation failed — check the message field |
| 429 | Rate limit hit — see Retry-After |
| 503 | Upstream temporarily unavailable — retry shortly |