Seed Speech 2.0 API 呼叫參考
41 種音色,用白話設定語氣
只要一把 PopNow API 金鑰,就能在自己的程式裡呼叫 Seed Speech 2.0。以下列出要填的呼叫名稱、這個型號接受的每個輸入欄位、每次請求花多少點數,以及一段可以直接貼進終端機執行的請求。
參數說明直接取自型號的輸入 schema,目前只有英文。
總覽
- 開發商
- ByteDance
- 產出
- 音訊
- 起價
- 10.8 點 每 1000 字元 ($0.108)
- 一般耗時
- 約 9 秒
1 點 = 0.01 美元。任務受理時會先保留可能的最高費用,完成後依實際用量結算、無條件進位到整點,多保留的會退回;失敗的任務不扣點數。想在執行前知道確切數字,請先呼叫 POST /api/v1/jobs/quote。
文字轉語音
bytedance/seed-speech-2.0/text-to-speech
價格
| 選項 | 點數 (每 1000 字元) | 美元 |
|---|---|---|
預設 | 10.8 | $0.108 |
參數
| 欄位 | 型別 | 預設值 | 可用值 | 用途 |
|---|---|---|---|---|
text必填 | string | — | 最多 5000 個字元 | The words to be spoken, exactly as written. Billed per 1,000 characters. |
voice_id選填 | string | stokie_en | vivi_mixed_en_zh_ja_es_id, mindy_en_es_id_pt_zh, stokie_en, dacey_en, tim_en, kian_en_zh, cedric_en_zh, sophie_en_zh, jean_en_zh, magnus_en_zh, mabel_en_zh, nadia_en_zh, opal_en_zh, pearl_en_zh, … (+27) | Preset voice. The suffix shows the languages it is built for. |
instructions選填 | string | — | 最多 1000 個字元 | How to read the text: tone, emotion, pace or volume. Not spoken and not billed. |
speed選填 | number | 1 | 0.5 到 2 | Speaking rate; 1 is the voice's normal pace. |
pitch選填 | integer | 0 | -12 到 12 | Pitch shift in semitones; 0 keeps the voice's own pitch. |
volume選填 | number | 1 | 0.5 到 2 | Loudness multiplier; 1 is the normal level. |
language選填 | string | — | zh, en, ja, es-mx, id, pt-br, ko, it, de, fr | Forces the reading language. Leave empty to detect it from the text. |
output_format選填 | string | mp3 | mp3, opus | File format of the result; opus is an Ogg Opus file. |
sample_rate選填 | integer | — | 8000, 16000, 22050, 24000, 32000, 44100, 48000 | Sample rate in Hz. The model uses 24000 when omitted. |
請求範例
這段請求原樣就能執行,沒寫的欄位都用預設值。執行前請先把金鑰放進環境變數 POPNOW_API_KEY。
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask?wait=60" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "bytedance/seed-speech-2.0/text-to-speech",
"input": {
"text": "Hi there! This voice was created with the PopNow API in just a few seconds."
}
}'回應會立刻帶回 taskId。之後用 GET /api/v1/jobs/recordInfo 取得結果,或在請求裡加上 callBackUrl 等候通知。
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
