API 레퍼런스
Fish Audio 음성 생성
create voice 엔드포인트를 사용하여 동일한 응답에서 결과를 받으세요.
01
개요
create voice 엔드포인트를 사용하고 동일한 응답에서 결과를 읽으세요.
빠른 시작
- API 키를 만들고 RUNAPI_API_KEY로 설정합니다.
- 요청 스키마와 일치하는 본문으로 POST 요청을 전송하세요.
- 성공 응답 본문에서 결과를 읽습니다.
엔드포인트
- Base URL
https://runapi.ai- API 버전
v1- 인증
Authorization: Bearer YOUR_API_TOKEN
02
지원 모델
현재 가격, 속도 제한 및 상업적 이용 세부 정보는 모델 페이지를 여십시오.
03
JSON 본문요청 스키마
이 엔드포인트에 선언된 필드만 전송하세요.
요청 본문필드 2개
namestring
필수
source_audio_urlstring
필수
04
HTTP 200성공 응답
POST /api/v1/fish_audio/voices
응답 스키마
JSON
{
"properties": {
"billing": {
"properties": {
"refund": {
"oneOf": [
{
"properties": {
"refunded_at": {
"type": "string"
}
},
"required": [
"refunded_at"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"reservation": {
"oneOf": [
{
"properties": {
"amount_cents": {
"type": "integer"
}
},
"required": [
"amount_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"settlement": {
"oneOf": [
{
"properties": {
"amount_micro_cents": {
"type": "integer"
},
"charged_amount_cents": {
"type": "integer"
}
},
"required": [
"charged_amount_cents",
"amount_micro_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
}
},
"required": [
"reservation",
"settlement",
"refund"
],
"type": "object",
"unevaluatedProperties": false
},
"voice": {
"properties": {
"name": {
"type": "string"
},
"state": {
"enum": [
"created",
"training",
"trained",
"failed"
],
"type": "string"
},
"voice_id": {
"type": "string"
}
},
"required": [
"voice_id",
"state"
],
"type": "object",
"unevaluatedProperties": false
}
},
"required": [
"voice",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"voice": {
"name": "Studio Narrator",
"state": "trained",
"voice_id": "voice_reference_narrator"
}
}
05
HTTP 401오류
POST /api/v1/fish_audio/voices
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "Authentication required"
}
06
HTTP 400오류
POST /api/v1/fish_audio/voices
응답 스키마
JSON
{
"oneOf": [
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 유효성 검사 요약입니다.",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "공개 요청 필드를 키로 하는 유효성 검사 메시지로, 각 필드에 대해 사람이 읽을 수 있는 문자열 배열이 포함됩니다.",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
응답 예시
JSON
{
"error": "Validation failed",
"errors": {
"name": [
"is required"
]
}
}
07
HTTP 402오류
POST /api/v1/fish_audio/voices
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "Insufficient balance"
}
08
HTTP 429오류
POST /api/v1/fish_audio/voices
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "API key credit limit exceeded"
}
09
HTTP 409오류
POST /api/v1/fish_audio/voices
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "The request uses features that are not supported for the selected model"
}
10
HTTP 429오류
POST /api/v1/fish_audio/voices
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "Rate limit reached. Please retry later."
}
11
HTTP 503오류
POST /api/v1/fish_audio/voices
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "Service under maintenance, please try again later"
}
12
HTTP 504오류
POST /api/v1/fish_audio/voices
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "The request timed out"
}
13
생성된 코드 샘플
cURL을 직접 사용하거나 해당 언어의 SDK를 설치하세요. 각 샘플은 이 레퍼런스에 표시된 유효성 검사된 요청을 제출합니다.
설치
Shell
pip install runapi-fish-audio
PYTHON
import os
from runapi.fish_audio import FishAudioClient
client = FishAudioClient(api_key=os.environ["RUNAPI_API_KEY"])
result = client.create_voice.run(
name="Studio Narrator",
source_audio_url="https://cdn.runapi.ai/public/samples/voice.mp3"
)