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.