API Referansı
Fish Audio Ses Oluşturma
Aynı yanıtta bir sonuç almak için ses tonu oluşturma uç noktasını kullanın.
01
Genel Bakış
Ses tonu oluşturma uç noktasını kullanın ve sonucu aynı yanıttan okuyun.
Hızlı başlangıç
- Bir API anahtarı oluşturun ve RUNAPI_API_KEY olarak ayarlayın.
- Gövdesi istek şemasıyla eşleşen bir POST isteği gönderin.
- Sonucu başarılı yanıt gövdesinden okuyun.
Uç Nokta
- Temel URL
https://runapi.ai- API sürümü
v1- Kimlik doğrulama
Authorization: Bearer YOUR_API_TOKEN
02
Desteklenen modeller
Güncel fiyatlandırma, hız sınırları ve ticari kullanım ayrıntıları için bir model sayfası açın.
03
JSON gövdesiİstek şeması
Yalnızca bu uç nokta için bildirilen alanları gönderin.
İstek gövdesi2 alan
namestring
Zorunlu
source_audio_urlstring
Zorunlu
04
HTTP 200Başarılı yanıt
POST /api/v1/fish_audio/voices
Yanıt şeması
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
}
Yanıt örneği
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"voice": {
"name": "Studio Narrator",
"state": "trained",
"voice_id": "voice_reference_narrator"
}
}
05
HTTP 401Hatalar
POST /api/v1/fish_audio/voices
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "Authentication required"
}
06
HTTP 400Hatalar
POST /api/v1/fish_audio/voices
Yanıt şeması
JSON
{
"oneOf": [
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir doğrulama özeti.",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "Herkese açık istek alanına göre anahtarlanan doğrulama mesajları; her alan için insan tarafından okunabilir dizelerden oluşan bir dizi içerir.",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
Yanıt örneği
JSON
{
"error": "Validation failed",
"errors": {
"name": [
"is required"
]
}
}
07
HTTP 402Hatalar
POST /api/v1/fish_audio/voices
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "Insufficient balance"
}
08
HTTP 429Hatalar
POST /api/v1/fish_audio/voices
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "API key credit limit exceeded"
}
09
HTTP 409Hatalar
POST /api/v1/fish_audio/voices
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "The request uses features that are not supported for the selected model"
}
10
HTTP 429Hatalar
POST /api/v1/fish_audio/voices
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "Rate limit reached. Please retry later."
}
11
HTTP 503Hatalar
POST /api/v1/fish_audio/voices
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "Service under maintenance, please try again later"
}
12
HTTP 504Hatalar
POST /api/v1/fish_audio/voices
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "The request timed out"
}
13
Oluşturulan Kod Örnekleri
Doğrudan cURL kullanın veya diliniz için bir SDK yükleyin. Her örnek, bu başvuruda gösterilen doğrulanmış isteği gönderir.
Yükle
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"
)