Qubittron Bastion
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_audio

Note 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

FieldTypeRequiredNotes
textstringyesText to synthesize (min 1 char)
language_codestringyesOne of en-US, de-DE, es-ES, it-IT
encodingnumberyesRiva audio encoding (e.g. 1 = LINEAR_PCM)
sample_rate_hznumberyese.g. 22050, 44100
voice_namestringyese.g. English-US.Female-1

The request is routed by language_code to the matching per-language upstream.

Supported models / languages

ModelLanguage
tts-en-usEnglish (US) — en-US
tts-de-deGerman — de-DE
tts-es-esSpanish (Spain) — es-ES
tts-it-itItalian — 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.pcm

The 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 -d

Errors

StatusCodeWhen
400invalid_requestBody failed validation
400language_not_supportedlanguage_code not in [en-US, de-DE, es-ES, it-IT]
401invalid_api_keyMissing/invalid Bearer token
402insufficient_fundsAccount credit exhausted
429rate_limit_exceededRate limit hit
502upstream_errorUpstream Riva returned 5xx

Pricing

Metered per character of input text.

On this page