跳到正文
API 参考
API 参考

Fish Audio List-Voices

Page through the public and personal voices available to your account.

01

概览

提交List Voices请求,并直接使用同一响应返回的结果。

快速开始

  1. 创建 API Key,并将其设置为 RUNAPI_API_KEY。
  2. 发送与请求 Schema 匹配的 POST 请求。
  3. 从成功响应正文中读取结果。

端点

GET /api/v1/fish_audio/voices
基础 URL
https://runapi.ai
API 版本
v1
身份验证
Authorization: Bearer YOUR_API_TOKEN
02

支持的模型

打开模型页可查看当前价格、限流和商业使用详情。

03

请求 Schema

JSON 请求体

只发送此端点声明的字段。

请求体2 个字段
page_numberinteger
可选 默认值: 1 边界: 1
page_sizeinteger
可选 默认值: 10 范围: 1 - 100
04

成功响应

HTTP 200

GET /api/v1/fish_audio/voices

响应 Schema
JSON
{
  "properties": {
    "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"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "page_number": 1,
  "page_size": 10,
  "total": 1,
  "voices": [
    {
      "name": "Studio Narrator",
      "state": "trained",
      "voice_id": "voice_reference_narrator"
    }
  ]
}
05

错误

HTTP 401

GET /api/v1/fish_audio/voices

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Authentication required"
}
06

错误

HTTP 400

GET /api/v1/fish_audio/voices

响应 Schema
JSON
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "Human-readable error message.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "Human-readable validation summary.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Validation messages keyed by public request field, with an array of human-readable strings for each field.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}

响应示例

JSON
{
  "error": "page_number must be greater than or equal to 1"
}
07

错误

HTTP 402

GET /api/v1/fish_audio/voices

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Insufficient balance"
}
08

错误

HTTP 429

GET /api/v1/fish_audio/voices

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "API key credit limit exceeded"
}
09

错误

HTTP 409

GET /api/v1/fish_audio/voices

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "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

GET /api/v1/fish_audio/voices

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Rate limit reached. Please retry later."
}
11

错误

HTTP 503

GET /api/v1/fish_audio/voices

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Service under maintenance, please try again later"
}
12

错误

HTTP 504

GET /api/v1/fish_audio/voices

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "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.list_voices.run(
  page_number=1,
  page_size=10
)