PlatformAPI documentation

Developer docs

8. Text-to-speech and speech recognition APIs

Version 1.0 · 2026-10-20

← Back to the API reference

Text to speech POST /v1/audio/speech

Turns text into speech, with emotion controlled by a text description. The response is the audio file itself. Streaming is not supported: the audio is returned once synthesis is complete, and the backend timeout is 300 seconds.

ParameterTypeRequiredDescription
modelstringYesindextts2
inputstringYesText to synthesize, up to 2,000 characters
voicestringYesVoice id provided by Power Champion; an unregistered voice returns 400
response_formatstringNomp3 (default), opus (Ogg container), wav
speednumberNoNot currently supported by indextts2; ignored
instructstringNoEmotion description, for example “開心、雀躍” (happy, excited)
emo_alphanumberNoEmotion strength, 0–1; 0.6 recommended

Response headers: X-Audio-Seconds is the audio length in seconds, and X-Usage-Tokens is the billed amount (50 tokens per second).

bash
curl https://b300.powerchampion.ai/v1/audio/speech \
  -H "Authorization: Bearer $PC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "indextts2",
    "input": "您好,歡迎來電,請問有什麼可以為您服務?",
    "voice": "<音色 id>",
    "instruct": "親切、溫和",
    "emo_alpha": 0.6
  }' \
  --output greeting.mp3

Split long text by sentence and synthesize each part separately. You wait less, and you stay under the 2,000-character limit.

Speech recognition POST /v1/audio/transcriptions

Transcribes audio to text. Chinese results are converted to Traditional Chinese (Taiwan). Upload the request as multipart/form-data.

ParameterTypeRequiredDescription
filefileYesAudio file, up to 25 MB; keep each segment to 600 seconds or less
modelstringYeswhisper-large-v3
languagestringNozh or en; detected automatically when left empty
promptstringNoHints for proper nouns or terminology, which can improve accuracy
response_formatstringNojson (default, includes usage) or text
temperaturenumberNo0–1
bash
curl https://b300.powerchampion.ai/v1/audio/transcriptions \
  -H "Authorization: Bearer $PC_API_KEY" \
  -F file=@meeting.mp3 \
  -F model=whisper-large-v3 \
  -F language=zh
json
{
  "text": "今天的會議重點有三個…",
  "language": "zh",
  "duration": 42.6,
  "usage": { "prompt_tokens": 0, "completion_tokens": 2130, "total_tokens": 2130 }
}

Formats whose length can be read (such as wav and flac) return 400 when longer than 600 seconds; other formats are not guaranteed to be checked. Uploads over 25 MB return 413. Split long recordings into segments of 10 minutes or less before uploading.