API リファレンステキスト読み上げテキスト読み上げ(同期)
同期テキスト読み上げ v2
既存クライアント向け HTTP v2 互換契約。
V2 は既存クライアント向けです。新規統合は v3 を使用してください。
Endpoint
POST /api/open/v2/speech/tts完全な URL:
https://fishaudio.org/api/open/v2/speech/tts認証とリクエストヘッダー
Authorization: Bearer FISHAUDIO_API_KEY
Content-Type: application/json
X-Request-Id: YOUR_STABLE_REQUEST_IDリクエストフィールド
| field | type | required | constraints |
|---|---|---|---|
text | string | yes | 1–10,000 |
voiceId | string | yes | must support modelId |
modelId | string | no | public model ID |
format | string | no | mp3, wav, ogg; default mp3 |
speed | number | no | 0.5–2; default 1 |
volume | number | no | -20–20; default 0 |
pitch | number | no | -12–12 |
stability | number | no | 0.5–1.5 |
similarity | number | no | 0.5–1.5 |
language | string | no | 1–64 characters in v3 |
emotion | string | no | 1–64 characters in v3 |
instruction | string | no | up to 1,600 characters |
textNormalization | boolean | no | structured-text normalization |
V2 also accepts legacy engineModelId, version, qwenModel, and minimaxEmotion fields. Do not use them in new clients.
curl
curl "https://fishaudio.org/api/open/v2/speech/tts" \
-H "Authorization: Bearer $FISHAUDIO_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Request-Id: legacy-tts-001" \
-d '{"text":"Hello","voiceId":"00a1b221-6137-4b73-ad62-b0cbce134167","modelId":"fishaudio-s21pro-flash","format":"mp3"}' --output speech.mp3成功レスポンス
成功時は音声バイナリです。HTTP ステータスと Content-Type を確認し、エラーは JSON として処理します。
エラーと再試行
400 不正な要求、401 無効なキー、402 クォータ不足、404 未検出、409 冪等性競合、413 過大、429 制限、500 生成失敗。
Migration
既存 v1/v2 クライアントは互換です。新規統合は v3 を使用します。 Migration guide.