Dokumentacja API
Fish Audio Lista głosów
Użyj punktu końcowego list voices, aby otrzymać wynik w tej samej odpowiedzi.
01
Omówienie
Użyj punktu końcowego list voices i odczytaj wynik z tej samej odpowiedzi.
Szybki start
- Utwórz klucz API i ustaw go jako RUNAPI_API_KEY.
- Wyślij żądanie POST, którego treść odpowiada schematowi żądania.
- Odczytaj wynik z treści pomyślnej odpowiedzi.
Punkt końcowy
- Bazowy URL
https://runapi.ai- Wersja API
v1- Uwierzytelnianie
Authorization: Bearer YOUR_API_TOKEN
02
Obsługiwane modele
Otwórz stronę modelu, aby zapoznać się z aktualnymi cenami, limitami żądań i szczegółami dotyczącymi użytku komercyjnego.
03
Treść JSONSchemat żądania
Wysyłaj wyłącznie pola zadeklarowane dla tego punktu końcowego.
Treść żądania2 pola
page_numberinteger
Opcjonalne
Domyślna wartość:
1
Zakres: 1
page_sizeinteger
Opcjonalne
Domyślna wartość:
10
Zakres: 1 - 100
04
HTTP 200Odpowiedź sukcesu
GET /api/v1/fish_audio/voices
Schemat odpowiedzi
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
},
"page_number": {
"type": "integer"
},
"page_size": {
"type": "integer"
},
"total": {
"type": "integer"
},
"voices": {
"items": {
"properties": {
"name": {
"type": "string"
},
"state": {
"enum": [
"created",
"training",
"trained",
"failed"
],
"type": "string"
},
"voice_id": {
"type": "string"
}
},
"required": [
"voice_id",
"state"
],
"type": "object",
"unevaluatedProperties": false
},
"type": "array"
}
},
"required": [
"voices",
"total",
"page_number",
"page_size",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
Przykład odpowiedzi
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"page_number": 1,
"page_size": 10,
"total": 1,
"voices": [
{
"name": "Studio Narrator",
"state": "trained",
"voice_id": "voice_reference_narrator"
}
]
}
05
HTTP 401Błędy
GET /api/v1/fish_audio/voices
Schemat odpowiedzi
JSON
{
"properties": {
"error": {
"description": "Czytelny dla człowieka komunikat o błędzie.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Przykład odpowiedzi
JSON
{
"error": "Authentication required"
}
06
HTTP 400Błędy
GET /api/v1/fish_audio/voices
Schemat odpowiedzi
JSON
{
"oneOf": [
{
"properties": {
"error": {
"description": "Czytelny dla człowieka komunikat o błędzie.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "Czytelne dla człowieka podsumowanie walidacji.",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "Komunikaty walidacyjne identyfikowane przez publiczne pole żądania, z tablicą czytelnych dla człowieka ciągów znaków dla każdego pola.",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
Przykład odpowiedzi
JSON
{
"error": "page_number must be greater than or equal to 1"
}
07
HTTP 402Błędy
GET /api/v1/fish_audio/voices
Schemat odpowiedzi
JSON
{
"properties": {
"error": {
"description": "Czytelny dla człowieka komunikat o błędzie.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Przykład odpowiedzi
JSON
{
"error": "Insufficient balance"
}
08
HTTP 429Błędy
GET /api/v1/fish_audio/voices
Schemat odpowiedzi
JSON
{
"properties": {
"error": {
"description": "Czytelny dla człowieka komunikat o błędzie.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Przykład odpowiedzi
JSON
{
"error": "API key credit limit exceeded"
}
09
HTTP 409Błędy
GET /api/v1/fish_audio/voices
Schemat odpowiedzi
JSON
{
"properties": {
"error": {
"description": "Czytelny dla człowieka komunikat o błędzie.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Przykład odpowiedzi
JSON
{
"error": "The request uses features that are not supported for the selected model"
}
10
HTTP 429Błędy
GET /api/v1/fish_audio/voices
Schemat odpowiedzi
JSON
{
"properties": {
"error": {
"description": "Czytelny dla człowieka komunikat o błędzie.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Przykład odpowiedzi
JSON
{
"error": "Rate limit reached. Please retry later."
}
11
HTTP 503Błędy
GET /api/v1/fish_audio/voices
Schemat odpowiedzi
JSON
{
"properties": {
"error": {
"description": "Czytelny dla człowieka komunikat o błędzie.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Przykład odpowiedzi
JSON
{
"error": "Service under maintenance, please try again later"
}
12
HTTP 504Błędy
GET /api/v1/fish_audio/voices
Schemat odpowiedzi
JSON
{
"properties": {
"error": {
"description": "Czytelny dla człowieka komunikat o błędzie.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Przykład odpowiedzi
JSON
{
"error": "The request timed out"
}
13
Wygenerowane przykłady kodu
Używaj bezpośrednio cURL lub zainstaluj SDK dla swojego języka. Każdy przykład przesyła zwalidowane żądanie pokazane w tej dokumentacji.
Instalacja
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.list_voices.run(
page_number=1,
page_size=10
)