Text-to-Speech (TTS) Endpoints

OpenAI-compatible text-to-speech: POST /v1/audio/speech.

1. Speech Synthesis

  • Path: /v1/audio/speech
  • Request Method: POST

Request Parameters

ParameterTypeRequiredDescription
modelstringYesTTS model name, e.g., tts-1 (OpenAI), seed-tts-2.0 (Volcengine Speech LLM)
inputstringYesThe text to be synthesized into speech. The maximum length is determined by the specific model specifications
voicestringYesVoice identity/timbre. For Volcengine Ark, pass the speaker ID (e.g., zh_female_vv_uranus_bigtts)
response_formatstringNoAudio format. Options: mp3 (default), opus, aac, flac, wav, pcm
speednumberNoSpeed adjustment factor (0.25 to 4.0, default is 1.0)

Calling Example

curl -X POST https://www.tokenpad.ai/v1/audio/speech \
  -H "Authorization: Bearer sk-your_token" \
  -H "Content-Type: application/json" \
  -o output.mp3 \
  -d '{
    "model": "seed-tts-2.0",
    "input": "Hello, welcome to the unified intelligent text-to-speech system. Please enter the text you wish to synthesize below.",
    "voice": "zh_female_vv_uranus_bigtts",
    "response_format": "mp3"
  }'

[!NOTE] The gateway returns a raw binary audio stream for this endpoint (HTTP binary response with Content-Type set to audio/mpeg or the corresponding audio format). It returns a binary audio stream that can be saved directly as a file for playback.

Raw Markdown (.md) · llms.txt