TECHNICAL REFERENCE CLI · HTTP API · TYPESCRIPT SDK · MCP

API & Local Setup Reference

Everything needed to run VoxLoom locally in Node 20+, serve OpenAI-compatible speech endpoints, configure native Turkish Piper models, or connect AI agents over MCP stdio.

LOCAL SERVER SPEC · :8880
STATUS 200 OK FORMAT audio/wav
POST /v1/audio/speech HTTP/1.1
# Response mastering headers
X-VoxLoom-Voice: tr_fahrettin
X-VoxLoom-Lufs:  -16.0
X-VoxLoom-Peak-Db: -1.0
X-VoxLoom-Backend: piper
01 / HTTP ENDPOINTS

OpenAI-compatible local speech server.

Start with npx voxloom serve --port 8880. Every audio response returns real mastering telemetry headers alongside the WAV or PCM16 payload.

Endpoint Payload / Query Behavior & Telemetry
POST /v1/audio/speech { model, input, voice, speed, response_format, lang, master, dialogue } Returns mastered audio/wav or audio/pcm plus headers X-VoxLoom-Lufs, X-VoxLoom-Peak-Db, X-VoxLoom-Voice, and X-VoxLoom-Elapsed-Ms.
GET /v1/voices ?lang=tr&backend=piper&webgpu=true Lists matching open-weight voices (66 total) plus the openaiAliases map (alloy, nova, shimmer, onyx, echo, fable).
POST /v1/normalize { input, lang } Runs offline spoken-text normalization and prosody chunking without loading neural model weights.
GET /health None Returns service status, package version, and registered catalog count for container health checks.
02 / BACKEND SETUP

Turkish Piper ONNX, Kokoro-82M, and local GPU servers.

VoxLoom separates spoken-text prosody and audio mastering from neural inference so you can pair any open-weight backend cleanly.

Kokoro-82M (Node CPU, 54 voices)

Install the optional Apache-2.0 ONNX runtime package once. Model weights download automatically on first call.

npm install voxloom kokoro-js
npx voxloom speak "Hello studio." --voice af_heart --out hello.wav

Native Turkish via Piper VITS ONNX

Download tr_TR-fahrettin-medium.onnx and its .onnx.json from rhasspy/piper-voices into ./models and run:

export VOXLOOM_PIPER_DIR=./models
npx voxloom speak "Saat 14:30 için ₺250 hazır." --lang tr --out tr.wav

Local GPU Server (VoxCPM / Qwen3-TTS)

Forward synthesis to any OpenAI-compatible local GPU server while keeping VoxLoom normalization and -16 LUFS mastering:

npx voxloom speak "Studio master check." \
  --openai-url http://127.0.0.1:8000/v1 \
  --out gpu-mastered.wav

LLM Token Streaming Chunker

Feed incremental tokens directly from an LLM stream and synthesize each completed sentence without waiting for the full reply:

import { createStreamingChunker } from "voxloom";
const chunker = createStreamingChunker();
for await (const token of llmStream) {
  for (const chunk of chunker.push(token)) {
    await enqueueSpeech(chunk.text);
  }
}
03 / CLI & MCP TOOLS

Commands and agent tool schemas.

Every core capability is available both from your shell and over newline-delimited JSON-RPC 2.0 via voxloom mcp.

CLI Command / MCP Tool Purpose Key Options
voxloom speak / speak_text Synthesize normalized, -16 LUFS mastered WAV speech. --voice, --lang, --speed, --out, --no-master
voxloom dialogue / synthesize_dialogue Render multi-speaker [Speaker]: ... scripts with turn pauses. --voices Host=af_heart,Guest=am_michael
voxloom normalize / normalize_speech Expand Turkish and English numbers, currencies, dates, and URLs offline. --lang tr|en|auto, --json
voxloom voices / list_voices Inspect all 66 open-weight voices and WebGPU readiness. --lang, --backend kokoro|piper, --json
voxloom serve Start the local OpenAI-compatible /v1/audio/speech HTTP server. --port 8880, --host 127.0.0.1, --openai-url
voxloom mcp Run the Model Context Protocol JSON-RPC 2.0 stdio server for AI agents. --piper-dir, --openai-url