API reference
Text to speech
POST /api/v1/tts/text_to_audio — synthesize audio from text via NVIDIA Riva.
POST https://api.qubittron.ai/api/v1/tts/text_to_audioNote the path: TTS lives under
/api/v1/tts/..., not/v1/.... The upstream is NVIDIA Riva and the URL mirrors its native shape.
Authentication
Authorization: Bearer qbt_<key>
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
text | string | yes | Text to synthesize (min 1 char) |
language_code | string | yes | One of en-US, de-DE, es-ES, it-IT |
encoding | number | yes | Riva audio encoding (e.g. 1 = LINEAR_PCM) |
sample_rate_hz | number | yes | e.g. 22050, 44100 |
voice_name | string | yes | e.g. English-US.Female-1 |
The request is routed by language_code to the matching per-language upstream.
Supported models / languages
| Model | Language |
|---|---|
tts-en-us | English (US) — en-US |
tts-de-de | German — de-DE |
tts-es-es | Spanish (Spain) — es-ES |
tts-it-it | Italian — it-IT |
Examples
curl https://api.qubittron.ai/api/v1/tts/text_to_audio \
-H "Authorization: Bearer $QUBITTRON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello from Qubi Bastion.",
"language_code": "en-US",
"encoding": 1,
"sample_rate_hz": 22050,
"voice_name": "English-US.Female-1"
}' \
--output speech.pcmThe OpenAI Node SDK does not model NVIDIA Riva's TTS contract — it expects an audio response shape that doesn't match. Use fetch (next tab) or any HTTP client. There is no SDK helper to wrap.
import { writeFileSync } from "node:fs";
const res = await fetch(
"https://api.qubittron.ai/api/v1/tts/text_to_audio",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.QUBITTRON_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Hello from Qubi Bastion.",
language_code: "en-US",
encoding: 1,
sample_rate_hz: 22050,
voice_name: "English-US.Female-1",
}),
},
);
if (!res.ok) throw new Error(`tts failed: ${res.status}`);
writeFileSync("/tmp/speech.pcm", Buffer.from(await res.arrayBuffer()));Response
Binary audio bytes, with Content-Type set to match the requested encoding. Status 200 on success. For LINEAR_PCM (encoding: 1), play raw on macOS:
sox -t raw -r 22050 -e signed -b 16 -c 1 speech.pcm -dErrors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | Body failed validation |
| 400 | language_not_supported | language_code not in [en-US, de-DE, es-ES, it-IT] |
| 401 | invalid_api_key | Missing/invalid Bearer token |
| 402 | insufficient_funds | Account credit exhausted |
| 429 | rate_limit_exceeded | Rate limit hit |
| 502 | upstream_error | Upstream Riva returned 5xx |
Pricing
Metered per character of input text.