Skip to content

Overview ​

xVoice is a speech API for production workloads: generate speech from text, transcribe audio files, and transcribe live audio while people are still talking.

The API follows OpenAI's audio API, so the official OpenAI SDKs work once you change the base URL and the key.

What you can build ​

ProductEndpointUse it for
Text to speechPOST /v1/audio/speechVoice agents, read-aloud and notifications. Streamed audio starts playing before the whole clip is generated
Speech to textPOST /v1/audio/transcriptionsRecordings, voicemail and uploaded files, up to 10 minutes each
Realtime transcriptionWS /v1/realtimePhone calls, meetings and microphones, with text arriving as people speak

Speech is generated by cadence-tts, and both kinds of transcription use cadence-stt. See Models and voices.

Usage is metered per second of audio and per character of text, and is never rounded up to the minute. Prices are on xvoice.dev, and how billing works is on Billing.

Make your first request ​

bash
export XVOICE_API_KEY=xv_...

curl https://api.xvoice.dev/v1/audio/speech \
  -H "Authorization: Bearer $XVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "cadence-tts", "voice": "clara", "input": "Hello from xVoice."}' \
  --output hello.wav

The quickstart goes from signup to a working round trip in about five minutes.

Base URL and SDKs ​

Every endpoint lives under one base URL:

text
https://api.xvoice.dev/v1

Use the official OpenAI SDK for your language, or any HTTP client:

python
from openai import OpenAI

client = OpenAI(api_key="xv_...", base_url="https://api.xvoice.dev/v1")
js
import OpenAI from 'openai'

const client = new OpenAI({ apiKey: 'xv_...', baseURL: 'https://api.xvoice.dev/v1' })

The examples on these pages read the key from $XVOICE_API_KEY. What is the same as OpenAI, and what is not, is listed on OpenAI compatibility.

Conventions ​

  • Authentication is a bearer token in the Authorization header, on every endpoint including the WebSocket. See Authentication.
  • Every response carries X-Request-Id, and every error body repeats it as request_id. Log it: it ties a support request to the exact call.
  • Errors share one envelope across all endpoints, with a stable code to branch on. See Errors.
  • Ids are prefixed by what they identify: org_…, proj_…, key_…, req_….
  • Lists return {"object": "list", "data": [...]}.
  • Unknown fields are errors on the realtime endpoint, so a misspelled setting fails loudly instead of being ignored.

Next steps ​

xVoice is a product of Stochastic Inc.