Fish Model Query API 對接說明

本介面基於 Fish Audio 官方 Model API,用於分頁檢索 Fish 公開音色庫或目前帳號下的複製音色。網址為 GET https://api.01ai.cloud/fish/model。

建立音色請參考 Fish Model Create API;按 _id 查詢單一音色詳情請參考 Fish Model Get API。

申請流程

要使用 Fish Model API,首先到 零壹AI 控制台 取得您的 API Token,留作備用。

如果你尚未登入或註冊,會自動跳轉到登入頁面邀請你註冊和登入,完成後會自動返回目前頁面。

通用應用程式的 API Key 可用於帳號已開放的服務;專用應用程式的 Key 按該應用程式的服務範圍使用。請檢查 Key 的權限、有效期和限額,並確認應用程式餘額足以支付本次請求。可用試用額度以帳號顯示為準,餘額不足時點擊「儲值」按鈕即可。

📘 完整文件:Fish Model API →

查詢參數

參數 類型 預設 說明
page_size integer 10 每頁筆數。
page_number integer 1 從 1 開始的頁碼。
title string — 按標題模糊搜尋。
tag string — 按單一標籤篩選。
self boolean — true 時僅回傳目前呼叫帳號透過本平台建立並儲存的音色。
author_id string — 按音色作者 ID 篩選。
language string — 按音色語種篩選,如 en、zh、es。
title_language string — 在公開音色庫中按標題語種篩選。
sort_by string — 排序欄位;self=true 時支援 created_at、task_count。

範例 1:預設翻頁(按 page_size)

curl -G 'https://api.01ai.cloud/fish/model' \
  -H 'authorization: Bearer {token}' \
  --data-urlencode 'page_size=2'

回傳(實測,公開庫總量約 180 萬筆;為方便閱讀,下例省略了部分較長的欄位):

{
  "total": 1829200,
  "items": [
    {
      "_id": "8d2c17a9b26d4d83888ea67a1ee565b2",
      "type": "tts",
      "title": "Valentino Narración Biblica Fer",
      "description": "A mature and authoritative male voice with a calm, spiritual tone...",
      "cover_image": "coverimage/8d2c17a9b26d4d83888ea67a1ee565b2",
      "train_mode": "fast",
      "state": "trained",
      "tags": ["male", "old", "narration", "calm", "Spanish"],
      "samples": [
        {
          "title": "Default Sample",
          "text": "Hermanos míos, recordemos las palabras del Señor...",
          "task_id": "59ce7df6935c42249759327ddf70f37b",
          "audio": "https://platform.r2.fish.audio/task/59ce7df6935c42249759327ddf70f37b.mp3"
        }
      ],
      "languages": ["es"],
      "visibility": "public",
      "like_count": 4344,
      "task_count": 708461,
      "author": {
        "_id": "1b82fb6a329c4462b67aa9ee0a42046f",
        "nickname": "Fernando Caicedo"
      }
    },
    {
      "_id": "90e65eaaf50e4470b8e6d43ee6afd7d5",
      "type": "tts",
      "title": "Super Smash Bros. 4/Ultimate Announcer",
      "tags": ["male", "old", "announcer", "gaming", "cinematic"],
      "languages": ["en"],
      "visibility": "public"
    }
  ],
  "has_more": null
}

範例 2:按標題模糊搜尋(title)

curl -G 'https://api.01ai.cloud/fish/model' \
  -H 'authorization: Bearer {token}' \
  --data-urlencode 'title=narration' \
  --data-urlencode 'page_size=2'

回傳(實測):

{
  "total": 161,
  "items": [
    {
      "_id": "fb8fe4a94658429d9be70efd4eec35a2",
      "type": "tts",
      "title": "Miles Morales ( Narration Paw )",
      "tags": ["male", "middle-aged", "entertainment", "storytelling", "Children's Content"],
      "languages": ["en"],
      "visibility": "public",
      "task_count": 770
    },
    {
      "_id": "76b55591c758444cb95253708696dfad",
      "type": "tts",
      "title": "Joe NARRATION",
      "tags": ["male", "middle-aged", "narration", "deep", "raspy"],
      "languages": ["en"],
      "visibility": "public"
    }
  ],
  "has_more": null
}

注意 title 是「全域模糊比對」,會同時匹配 Fish 公開庫的所有音色(不僅是自己的)。

範例 3:只列出自己建立的音色(self=true)

curl -G 'https://api.01ai.cloud/fish/model' \
  -H 'authorization: Bearer {token}' \
  --data-urlencode 'self=true' \
  --data-urlencode 'page_size=5'

回傳範例:

{
  "total": 1,
  "items": [
    {
      "_id": "e5c6db52c3ed417f9cb2e5a33fb04667",
      "type": "tts",
      "title": "copilot-smoke-test",
      "description": "smoke test from api.acedata.cloud",
      "state": "trained",
      "languages": ["zh"],
      "visibility": "public",
      "samples": [
        {
          "title": "Default Sample",
          "text": "师父,[语气坚定]我真的受够了这山上的清冷日子!...",
          "task_id": "6a1bf398dfae49dca0e23159214342a0",
          "audio": "https://platform.r2.fish.audio/task/6a1bf398dfae49dca0e23159214342a0.mp3"
        }
      ],
      "created_at": "2026-05-10T03:52:55.601000Z",
      "author": {
        "_id": "780f2b2f862d41a08c0507bbbda77eb6",
        "nickname": "Penny Conrad"
      }
    }
  ],
  "has_more": false
}

self=true 按實際呼叫帳號列出透過本平台建立並儲存的音色;同一帳號使用不同 API Token 建立的音色也會一起列出。結果按建立時間倒序分頁,author_id 可進一步篩選這些音色的作者 ID。此參數只篩選列表,音色仍公開可用。

self=true 不支援 title_language;如需按標題語種搜尋,請查詢公開音色庫。

範例 4:按語種 + 標籤篩選

curl -G 'https://api.01ai.cloud/fish/model' \
  -H 'authorization: Bearer {token}' \
  --data-urlencode 'language=zh' \
  --data-urlencode 'tag=narration' \
  --data-urlencode 'page_size=5'

tag 匹配較寬鬆;如果命中數為 0,建議改用 title 模糊匹配。

回應欄位

items[] 中的每一項是一個完整的 ModelEntity 物件,常用欄位:

欄位 類型 說明
_id string 音色 ID,作為 /fish/tts 中 reference_id 的值。
type string 模型類型,通常為 tts。
title string 音色名稱。
description string 音色描述。
state string 訓練狀態:trained 表示可用。
tags string[] 公共庫標籤。
languages string[] 音色擅長的語種。
visibility string public 或 private。
samples object[] 預設樣本(含 audio 直接連結)。
like_count integer 公共庫按讚數。
task_count integer 歷史合成次數。
author object 音色作者資訊:_id / nickname / avatar。
total(頂層) integer 符合條件的總筆數。
has_more boolean? self=true 時為布林值;公共音色庫查詢可能為 null。

計費說明

本介面不計費——分頁查詢音色清單是免費操作。建立音色(Fish Model Create)同樣免費,費用僅在呼叫 Fish TTS 合成語音時按用量產生。

錯誤處理

  • 400 token_mismatched:請求參數缺失或不合法。
  • 401 invalid_token:驗證 token 不存在或無效。
  • 429 too_many_requests:觸發帳號速率限制。
  • 500 api_error:伺服器內部錯誤。

錯誤回應範例:

{
  "success": false,
  "error": {
    "code": "api_error",
    "message": "fetch failed"
  },
  "trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}

結論

要從 Fish 公共庫挑選音色提供給 /fish/tts 的 reference_id,先用本介面配合 title / tag / language 搜尋,定位到目標 _id,再用 Fish Model Get 取得樣本試聽。要列出自己建立的音色,傳入 self=true 即可。