Fish Model Get API 對接說明
本介面基於 Fish Audio 官方 Model API,用於按 _id 查詢單個複製音色的完整詳情。位址為 GET https://api.yxai-tech.top/fish/model/{id}。
建立音色請參考 Fish Model Create API;分頁檢索請參考 Fish Model Query API。
¶ 申請流程
要使用 Fish Model API,首先到 AI 聚合控制台 取得您的 API Token,留作備用。

如果你尚未登入或註冊,會自動跳轉到登入頁面邀請你註冊和登入,完成後會自動返回目前頁面。
通用應用程式的 API Key 可用於帳號已開放的服務;專用應用程式的 Key 按該應用程式的服務範圍使用。請檢查 Key 的權限、有效期限和額度上限,並確認應用程式餘額足以支付本次請求。可用試用額度以帳號顯示為準,餘額不足時點擊「儲值」按鈕即可。
📘 完整文件:Fish Model API →
¶ 路徑參數
| 參數 | 必填 | 說明 |
|---|---|---|
id |
是 | 音色的 _id(32 位十六進位字串)。可透過 Fish Model Create 建立時返回,或透過 Fish Model Query 檢索取得。 |
無請求主體、無查詢參數。
¶ 範例:擷取一個公開西班牙語音色的完整詳情
curl 'https://api.yxai-tech.top/fish/model/8d2c17a9b26d4d83888ea67a1ee565b2' \
-H 'authorization: Bearer {token}'
返回(實測,刪去了 samples[].audio 中的簽名查詢字串以便閱讀):
{
"_id": "8d2c17a9b26d4d83888ea67a1ee565b2",
"type": "tts",
"title": "Valentino Narración Biblica Fer",
"description": "A mature and authoritative male voice with a calm, spiritual tone. It is well-suited for religious narration, educational content, and professional storytelling in Spanish.",
"cover_image": "coverimage/8d2c17a9b26d4d83888ea67a1ee565b2",
"train_mode": "fast",
"state": "trained",
"tags": [
"male", "old", "narration", "calm", "serious",
"authoritative", "professional", "clear", "Spanish"
],
"samples": [
{
"title": "Default Sample",
"text": "Hermanos míos, recordemos las palabras del Señor en estos tiempos difíciles. Como dice la Escritura, la fe mueve montañas, y el amor de Dios nos guía en cada paso del camino. Mantengamos firme nuestra confianza en Su divina providencia.",
"task_id": "59ce7df6935c42249759327ddf70f37b",
"audio": "https://c97f3361a1c971323738e24f451a0225.r2.cloudflarestorage.com/fish-platform-data/task/59ce7df6935c42249759327ddf70f37b.mp3?X-Amz-...signed..."
}
],
"created_at": "2025-03-13T08:11:10.326000Z",
"updated_at": "2026-05-03T09:01:41.437000Z",
"languages": ["es"],
"visibility": "public",
"lock_visibility": false,
"dmca_taken_down": false,
"default_text": "Hermanos míos, recordemos las palabras del Señor...",
"quality": null,
"like_count": 4344,
"mark_count": 4409,
"shared_count": 590,
"task_count": 708461,
"unliked": false,
"liked": false,
"marked": false,
"author": {
"_id": "1b82fb6a329c4462b67aa9ee0a42046f",
"nickname": "Fernando Caicedo",
"avatar": "avatars/1b82fb6a329c4462b67aa9ee0a42046f.jpg"
}
}
取得的 _id 直接傳給 Fish TTS 的 reference_id 即可合成相同音色的語音:
curl -X POST 'https://api.yxai-tech.top/fish/tts' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"text": "Hermanos míos, hoy es un buen día.",
"reference_id": "8d2c17a9b26d4d83888ea67a1ee565b2",
"format": "mp3"
}'
¶ 與列表介面的差異
| 欄位 | GET /fish/model(列表) |
GET /fish/model/{id}(詳情) |
|---|---|---|
samples[].audio |
短期 R2 快取 URL | 即時簽署的 R2 直連網址(含查詢簽名) |
unliked / liked / marked / dmca_taken_down |
同樣存在 | 同樣存在 |
default_text / lock_visibility |
同樣存在 | 同樣存在 |
如果只是要試聽一下,列表介面裡的 samples[].audio 已經夠用;要更穩定的下載連結,建議改用本介面。
¶ 回應欄位(節選)
| 欄位 | 類型 | 說明 |
|---|---|---|
_id |
string | 音色 ID(用於 /fish/tts 的 reference_id)。 |
type |
string | 模型類型,通常為 tts。 |
title |
string | 音色名稱。 |
description |
string | 長描述。 |
state |
string | 訓練狀態:trained 表示可用,training 表示還在訓練。 |
tags |
string[] | 公共庫標籤。 |
samples |
object[] | 預設樣本,含 title、text、task_id、audio 直連網址。 |
languages |
string[] | 音色擅長的語種代碼。 |
visibility |
string | public 或 private。 |
like_count |
integer | 公共庫按讚數。 |
task_count |
integer | 歷史合成次數(可用於人氣排序參考)。 |
author |
object | 作者資訊:_id / nickname / avatar。 |
created_at |
string | ISO 8601 建立時間。 |
updated_at |
string | ISO 8601 最近更新時間。 |
¶ 計費說明
本介面不計費——按 ID 查詢單個音色詳情是免費操作。建立音色(Fish Model Create)同樣免費,費用僅在呼叫 Fish TTS 合成語音時按用量產生。
¶ 錯誤處理
400 token_mismatched:路徑中的id不是合法格式,或音色不存在。401 invalid_token:驗證 token 不存在或無效。404 not_found:指定_id對應的音色無法存取(音色被刪除、設為私密,或屬於其他帳號)。429 too_many_requests:觸發帳號速率限制。500 api_error:伺服器內部錯誤。
請求不存在的 ID 時可能回傳 400 Model not found(實測):
curl 'https://api.yxai-tech.top/fish/model/test123' \
-H 'authorization: Bearer {token}'
回傳:
{ "status": 400, "message": "Model not found" }
錯誤回應範例:
{
"success": false,
"error": {
"code": "api_error",
"message": "fetch failed"
},
"trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}
¶ 結論
知道音色 _id 時直接用本介面取得完整 ModelEntity,最常見的用法是:(1) 試聽 samples[].audio,(2) 把 _id 傳給 /fish/tts 的 reference_id 完成合成。如果只有標題或標籤,請先用 Fish Model Query 檢索。

