Documentation

Speech synthesis

Soniqo Vox turns text into natural speech with built-in preset voices. The speech endpoint follows the OpenAI request shape, so existing client code works by changing the base URL.

1. Synthesize speech

The OpenAI-compatible endpoint is the simplest path — point the OpenAI SDK at the Soniqo base URL and call it as usual.

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(base_url="https://api.soniqo.audio/v1", api_key="sk_...")

client.audio.speech.create(
    model="tts-1",
    voice="af_heart",
    input="Hello from Soniqo.",
).stream_to_file("hello.wav")

Node (OpenAI SDK)

import OpenAI from "openai";
import fs from "fs";

const client = new OpenAI({ baseURL: "https://api.soniqo.audio/v1", apiKey: "sk_..." });

const res = await client.audio.speech.create({
  model: "tts-1",
  voice: "af_heart",
  input: "Hello from Soniqo.",
});
fs.writeFileSync("hello.wav", Buffer.from(await res.arrayBuffer()));

cURL

curl -X POST https://api.soniqo.audio/v1/audio/speech \
  -H "Authorization: Bearer $SONIQO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"tts-1","input":"Hello from Soniqo.","voice":"af_heart"}' \
  --output hello.wav

2. Low-latency streaming

Set response_format="pcm" to stream raw audio as it is generated — 24 kHz signed 16-bit little-endian mono, the format live voice runtimes expect. The X-Sample-Rate and X-Format response headers describe the stream. (For a full agent setup, see the voice-agents guide.)

curl -X POST https://api.soniqo.audio/v1/audio/speech \
  -H "Authorization: Bearer $SONIQO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"Streamed in real time.","voice":"af_heart","response_format":"pcm"}' \
  --output out.pcm   # 24 kHz s16le mono

3. Pick a voice

Pass a built-in preset ID in the voice field. OpenAI voice names such as nova and alloy are accepted for client compatibility and use the default preset. Fetch the catalog for the exact Soniqo IDs:

# Built-in preset catalog
curl https://api.soniqo.audio/v1/models/synthesize \
  -H "Authorization: Bearer $SONIQO_API_KEY"

4. Native endpoint

Prefer a non-OpenAI shape? POST /v1/synthesize takes JSON and returns a complete WAV (mono 24 kHz). Pass a preset ID as voice_id.

curl -X POST https://api.soniqo.audio/v1/synthesize \
  -H "Authorization: Bearer $SONIQO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Native synthesis.","voice_id":"af_heart"}' \
  --output out.wav

Pricing

Synthesis is $0.22 per minute of generated audio, billed per second with no minimum charge. See pricing.