Developer docs
8. Text-to-speech and speech recognition APIs
Version 1.0 · 2026-10-20
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.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | indextts2 |
input | string | Yes | Text to synthesize, up to 2,000 characters |
voice | string | Yes | Voice id provided by Power Champion; an unregistered voice returns 400 |
response_format | string | No | mp3 (default), opus (Ogg container), wav |
speed | number | No | Not currently supported by indextts2; ignored |
instruct | string | No | Emotion description, for example “開心、雀躍” (happy, excited) |
emo_alpha | number | No | Emotion 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).
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.mp3Split 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Audio file, up to 25 MB; keep each segment to 600 seconds or less |
model | string | Yes | whisper-large-v3 |
language | string | No | zh or en; detected automatically when left empty |
prompt | string | No | Hints for proper nouns or terminology, which can improve accuracy |
response_format | string | No | json (default, includes usage) or text |
temperature | number | No | 0–1 |
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{
"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.