コンテンツへスキップ
APIリファレンス
APIリファレンス

Fish Audio ボイス取得

get voiceエンドポイントを使用して、同じレスポンスで結果を受け取ってください。

01

概要

get voiceエンドポイントを使用し、同じレスポンスから結果を読み取ってください。

クイックスタート

  1. APIキーを作成し、RUNAPI_API_KEYとして設定します。
  2. 本文がリクエストスキーマと一致するPOSTリクエストを送信します。
  3. 成功レスポンスのボディから結果を読み取る。

エンドポイント

GET /api/v1/fish_audio/voices/:voice_id
ベースURL
https://runapi.ai
API バージョン
v1
認証
Authorization: Bearer YOUR_API_TOKEN
02

サポートされているモデル

現在の料金、レート制限、商用利用の詳細については、モデルページを開いてください。

03

リクエストスキーマ

JSONボディ

このエンドポイントで宣言されたフィールドのみを送信してください。

リクエストボディフィールド1件
voice_idstring
必須
04

成功レスポンス

HTTP 200

GET /api/v1/fish_audio/voices/:voice_id

レスポンススキーマ
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

GET /api/v1/fish_audio/voices/:voice_id

レスポンススキーマ
JSON
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

レスポンス例

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

エラー

HTTP 400

GET /api/v1/fish_audio/voices/:voice_id

レスポンススキーマ
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": {
    "voice_id": [
      "is required"
    ]
  }
}
07

エラー

HTTP 402

GET /api/v1/fish_audio/voices/:voice_id

レスポンススキーマ
JSON
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

レスポンス例

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

エラー

HTTP 429

GET /api/v1/fish_audio/voices/:voice_id

レスポンススキーマ
JSON
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

レスポンス例

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

エラー

HTTP 409

GET /api/v1/fish_audio/voices/:voice_id

レスポンススキーマ
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

GET /api/v1/fish_audio/voices/:voice_id

レスポンススキーマ
JSON
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "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/:voice_id

レスポンススキーマ
JSON
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "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/:voice_id

レスポンススキーマ
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.get_voice.run(
  voice_id="voice_reference_narrator"
)