Speech synthesis

Generate audio from text. Vox carries 149 in-house voices; MiniMax adds commercial voice cloning.

POST /v1/audio/speech

Try it

curl https://relayx.timor419.com/v1/audio/speech \
  -H "Authorization: Bearer $RELAYX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "vox/index-tts-2",
  "voice": "专业解说",
  "input": "你好,这是 RelayX 的语音合成。",
  "speed": 1,
  "response_format": "mp3"
}' \
  --output out.mp3

Parameters

  • `speed`: playback speed from 0.5 to 2.0. Defaults to 1.0; values above 1 are faster.
  • `response_format`: Vox supports mp3 and wav. url stores an upstream mp3 in RelayX R2 and returns a JSON URL.
  • Speed and format do not change character-based billing.

Voice catalog

List voices available for a TTS model. Vox returns its live catalog; other models return their built-in voice set. No auth required.

GET /v1/audio/voices?model=<id>

curl https://relayx.timor419.com/v1/audio/voices?model=vox/index-tts-2

{
  "object": "list",
  "model": "vox/index-tts-2",
  "data": [
    { "id": "云亮嘉", "label": "云亮嘉", "featured": true, "demo_url": "https://..." },
    { "id": "专业解说", "label": "专业解说" }
  ]
}

Voice cloning

Hand Vox a short reference clip and get back a permanent voice id you can pass to future /audio/speech calls — same timbre, any text.

Create

POST /v1/audio/voices/clone

Two input modes: multipart upload (the bytes) or JSON with a public audio_url (Vox fetches it itself). RelayX extension — no OpenAI equivalent.

Multipart — upload the .wav directly

  • file Reference audio. .wav only, ≤15 MB, ≤15 s. Re-uploading the exact same bytes returns the existing voice for free (`duplicate: true`).
  • name Display name, 1–64 chars, no path separators or control characters.
curl -X POST https://relayx.timor419.com/v1/audio/voices/clone \
  -H "Authorization: Bearer $RELAYX_API_KEY" \
  -F "file=@./reference.wav" \
  -F "name=My narrator"

JSON — point Vox at a public URL

  • audio_url Public http(s) URL of a .wav reference (≤15 MB, ≤15 s). Vox fetches it with a 30s timeout. Re-using the same URL when its bytes haven't changed also dedups for free.
  • name Display name, 1–64 chars, no path separators or control characters.
curl -X POST https://relayx.timor419.com/v1/audio/voices/clone \
  -H "Authorization: Bearer $RELAYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "audio_url": "https://example.com/reference.wav",
    "name": "My narrator"
  }'

Response (both modes)

{
  "object": "voice.clone",
  "model": "vox/voice-clone-v1",
  "duplicate": false,
  "voice": {
    "id": "cv-3f9a1b2c4d5e",
    "name": "My narrator",
    "demo_url": "https://oss.timor419.com/.../demo.mp3",
    "duration_sec": 8.4,
    "created_at": "2026-06-06T08:00:00.000Z"
  },
  "x_relayx": { "request_id": "rx_vc_…", "cost_usd": 0.000005 }
}

Use the cloned voice

Pass the returned `cv-…` id as `voice` to /v1/audio/speech with any vox/* synthesis SKU.

curl -X POST https://relayx.timor419.com/v1/audio/speech \
  -H "Authorization: Bearer $RELAYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "vox/index-tts-2",
    "input": "你好,这是我克隆的声音。",
    "voice": "cv-3f9a1b2c4d5e"
  }' \
  --output out.mp3

Delete

DELETE /v1/audio/voices/clone?voice_id=cv-…

Stops accepting the voice id. The original clone charge is non-refundable.

Limits

  • File / URL: .wav only, ≤ 15 MB, ≤ 15 seconds.
  • URL mode: must be a public http(s) URL; Vox refuses internal-network targets and times out the fetch at 30s.
  • Rate limit: 10 clones / minute (per API key).
  • Cost: a flat 300-character fee per successful clone — byte-identical re-uploads / same-URL re-fetches are free.

Errors

HTTPcodeMeaning
400not_wavFile is not a .wav (or magic bytes invalid).
400duration_exceededAudio is longer than 15 seconds.
400wav_parse_failedWAV header parses but the body is malformed.
400invalid_url`audio_url` is malformed or unresolvable.
400url_blocked`audio_url` points at an internal / disallowed network.
413file_too_largeUpload exceeds 15 MB.
413url_too_largeFetched audio at `audio_url` exceeds 15 MB.
429upstream_rate_limitedMore than 10 clones in the last minute.
502url_fetch_failedVox couldn't fetch `audio_url` within 30s (DNS, source flaking, etc.). Retry-safe.
502upstream_unavailableUpstream demo render failed (not billed — retry-safe).