語音合成

聲音克隆

對口型視頻

其他

查詢用戶信息

查詢用戶的 API 積分剩餘情況和基本信息

查詢用戶信息接口

接口地址

GET /api/open/profile

也支持 POST 請求,參數可通過 request body 或 Authorization header 傳遞

請求頭

Authorization: Bearer YOUR_API_TOKEN  // API 密鑰

請求參數 (POST 方式)

{
  "token": "YOUR_API_TOKEN"  // 可選,如果未在 header 中提供
}

返回數據

// 成功響應 - 200
{
  "user_id": "user_123",
  "api_quota_remaining": 1500,
  "tier": "free",
  "credits": 1000
}

// 錯誤響應
{
  "error": string  // 錯誤提示信息
}

響應字段說明

user_id: 用戶ID
api_quota_remaining: 剩餘 API 積分
tier: 用戶等級(free/pro/enterprise)
credits: 普通積分餘額

CURL 示例

# GET 請求
curl -X GET https://fishaudio.org/api/open/profile \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# POST 請求(通過 header)
curl -X POST https://fishaudio.org/api/open/profile \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{}'

# POST 請求(通過 body)
curl -X POST https://fishaudio.org/api/open/profile \
  -H "Content-Type: application/json" \
  -d '{
    "token": "YOUR_API_TOKEN"
  }'

在線調試

接口說明

  • • 支持 GET 和 POST 兩種請求方式
  • • GET 請求:通過 Authorization header 傳遞 token
  • • POST 請求:支持通過 header 或 request body 傳遞 token
  • • 返回用戶的積分餘額、等級等基本信息

狀態碼說明

狀態碼說明:
200 OK                  - 請求成功
400 Bad Request         - 請求參數錯誤
401 Unauthorized        - API Token 無效
403 Forbidden          - 禁止訪問
404 Not Found          - 資源不存在
413 Payload Too Large  - 上傳文件過大
429 Too Many Requests  - 請求頻率超限/積分不足
500 Server Error       - 服務器內部錯誤

錯誤響應格式:
{
  "error": string,      // 錯誤信息
  "details": string,    // 詳細錯誤信息(可選)
  "code": string       // 錯誤代碼(可選)
}