Catalog API · v1

模型信息 API 文档

使用你的 API Key,查询可用模型的能力参数、原价、个人倍率、倍率后价格、成功率和平均完成时间。

快速接入:通过 Authorization: Bearer <API Key> 请求 GET /v1/models,从 data 读取可用模型,从 model_info 读取能力、价格和统计信息。
01概览

调用流程

1. 准备 API Key使用你在 NewAPI 中可以正常调用的 Key。
2. 请求模型列表GET /v1/models
只读请求,不需要请求体。
3. 读取基础字段如 id、owned_by、supported_endpoint_types。
4. 读取扩展字段从 model_info 读取能力和定价信息。

查询模型信息不扣费。生成视频或图片请使用对应的任务接口。

02请求接口

GET /v1/models

GEThttps://catalog.sudashuiapi.com/v1/models

请求头

Header必填说明
Authorization是格式为 Bearer <NewAPI API Key>。必须使用真实有效的 NewAPI API Key。
Accept否建议设置为 application/json。

请求不需要 JSON body。不要使用 ?key=...、x-api-key 或其他自定义位置传 Key。

curl

curl --request GET \
  --url https://catalog.sudashuiapi.com/v1/models \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer 你的_NewAPI_API_Key'

JavaScript / Fetch

const response = await fetch("https://catalog.sudashuiapi.com/v1/models", {
  method: "GET",
  headers: {
    Accept: "application/json",
    Authorization: "Bearer 你的_NewAPI_API_Key"
  }
});

const result = await response.json();
if (!response.ok || result.success === false || result.ok === false) {
  throw new Error(result.error?.message || result.message || result.error || "请求失败");
}
console.log(result.data);

Python / requests

import requests

response = requests.get(
    "https://catalog.sudashuiapi.com/v1/models",
    headers={
        "Accept": "application/json",
        "Authorization": "Bearer 你的_NewAPI_API_Key",
    },
    timeout=15,
)
response.raise_for_status()
result = response.json()
if result.get("success") is False or result.get("ok") is False:
    raise RuntimeError(result.get("message") or result.get("error") or "请求失败")
models = result["data"]
03返回示例

成功响应:HTTP 200

下面是一个完整模型条目的示例。实际返回的模型以当前 API Key 可用的列表为准。

{
  "object": "list",
  "success": true,
  "data": [
    {
      "id": "sdas-qd-seedance-2.5-480p",
      "object": "model",
      "created": 1626777600,
      "owned_by": "vidu",
      "supported_endpoint_types": ["openai"],
      "model_info": {
        "display_name": "sdas-qd-seedance-2.5-480p",
        "modality": "video",
        "description": null,
        "resolution": "480p",
        "type": "s2.5",
        "supports_real_person": true,
        "billing_mode": "per_request",
        "duration": {"min": 4, "max": 30, "step": 1},
        "price": 9.6,
        "model_ratio": 0.85,
        "final_price": 8.16,
        "pricing_source": "legacy_group",
        "group_ratio_ignored": false,
        "model_ratio_range": null,
        "final_price_range": null,
        "statistics": {
          "success_rate": 98.5,
          "window_hours": 24,
          "avg_completion_ms": 648000,
          "stats_as_of": 1794096000,
          "last_activity_at": 1794095940,
          "status": "healthy",
          "consistent": true,
          "refresh_interval_seconds": 600,
          "stale": false
        },
        "currency": "CNY",
        "references": {"images": 30, "videos": 10, "audios": 10},
        "aspect_ratios": ["1:1", "3:4", "4:3", "9:16", "16:9", "21:9"]
      }
    }
  ]
}

顶层返回字段

字段类型说明
objectstring固定为 list。
successboolean成功时为 true;为 false 时请按错误响应处理。
dataarray模型对象数组。按模型 ID 排序;可能为空数组。

模型基础字段

字段类型说明
idstring模型唯一 ID。提交生成任务时通常使用此值作为模型名称。
objectstring固定为 model。
creatednumber模型创建时间,Unix 秒级时间戳。
owned_bystring模型所属方。
supported_endpoint_typesstring[]支持的接口类型,例如 ["openai"]。
model_infoobject模型能力、价格、素材限制和统计信息。

model_info 扩展字段

字段类型示例说明
display_namestringsdas-qd-seedance-2.5-480p模型展示名称。
modalitystringvideo模型类别。当前支持 video、image、other。
descriptionstring|nullnull模型描述,没有说明时为 null。
resolutionstring|null480p分辨率,例如 480p、720p、1080p、4k。
typestring|nulls2.5模型类型标签,例如 s2.0满血、s2.0fast、s2.0mini。
supports_real_personboolean|nulltrue是否支持真人内容。false 表示不支持,null 表示暂无信息。
billing_modestring|nullper_requestper_request 表示按次,per_second 表示按秒。
durationobject|null{min,max,step}允许的生成时长。连续范围和离散枚举见下方说明。
pricenumber|null9.6模型原价单价,未乘个人倍率;暂无价格时为 null。
model_rationumber|null0.85当前 Key 对此模型的有效倍率。倍率不唯一或未查到时为 null;0 是有效倍率。
final_pricenumber|null8.16倍率后展示单价,即 price × model_ratio。没有基础价或确定倍率时为 null,不是实际扣款金额。
pricing_sourcestring|nulllegacy_grouplegacy_group:分组计价;user_custom:用户专属计价;暂无倍率时为 null。
group_ratio_ignoredboolean|nullfalsetrue 表示专属模式,忽略分组倍率,不能再叠乘;未查到此模型倍率时为 null。
model_ratio_rangeobject|null{"min":0.333,"max":1}适用倍率不唯一时的最小、最大倍率;确定倍率或暂无倍率时为 null。
final_price_rangeobject|null{"min":3.1968,"max":9.6}基础价分别乘最小、最大倍率的展示范围;没有基础价或倍率范围时为 null。
statisticsobject|null{"success_rate":98.5,...}模型成功率、平均完成时间及更新时间,见下方统计字段说明;统计暂不可用时为 null。
currencystring|nullCNY价格币种,例如 CNY。
referencesobject|null{images:30,...}素材数量上限,分别统计图片、视频、音频。
aspect_ratiosstring[]["1:1", "16:9"]支持的画面比例列表。
04字段与规则

扩展字段的读取规则

时长 duration

连续时长使用范围对象:

{"min": 4, "max": 30, "step": 1}

离散时长使用枚举对象,不能当成连续范围:

{"values": [5, 8, 10, 12, 13, 15, 30]}

素材数量 references

{"images": 30, "videos": 10, "audios": 10}

0 表示不支持该类型素材;null 表示暂无信息,不能当作 0。

收费模式与价格

billing_mode=per_request 为按次计价,billing_mode=per_second 为按秒计价。price 和 final_price 使用相同币种与计费单位;按秒时 final_price 是每秒单价,整段视频的预估费用为单价 × 时长。

当前 Key 的倍率与展示价格

直接读取 model_ratio 和 final_price 即可获取当前 Key 的有效倍率与倍率后单价,无需再叠乘其他倍率。

  • legacy_group:分组计价,model_ratio 已包含适用的分组优惠。
  • user_custom 且 group_ratio_ignored=true:用户专属计价,不再叠乘分组倍率;没有专属优惠的模型倍率为 1.0。

例如原价 2.5、有效倍率 0.85,则 final_price=2.125;有效倍率 0.333 时为 0.8325。

适用倍率不唯一时,model_ratio 和 final_price 返回 null,改用范围字段。例如:

{
  "price": 9.6,
  "model_ratio": null,
  "final_price": null,
  "pricing_source": "user_custom",
  "group_ratio_ignored": true,
  "model_ratio_range": {"min": 0.333, "max": 1},
  "final_price_range": {"min": 3.1968, "max": 9.6}
}

范围表示可能适用的最低、最高单价。暂无倍率时不要自行按 1 补算;暂无原价时,价格字段为 null。

价格用于展示和费用预估,实际费用以任务结算为准。

成功率与平均完成时间

model_info.statistics 提供最新的模型统计,默认约每 10 分钟更新一次。可通过 stats_as_of 查看统计时间,通过 stale 判断数据是否延迟。

统计反映模型的整体表现,与同一用户在模型广场默认“全部分组”视图一致。模型广场单独筛选分组时,数值可能不同。

statistics 字段类型说明
success_ratenumber|null成功率百分数,98.5 表示 98.50%;0 是真实的 0%。有完成结果即返回实际成功率;无数据或统计不一致时为 null。
window_hoursinteger24 为近 24 小时;近期无完成结果时以 168 表示近 7 天历史;0 为无可用窗口。
avg_completion_msinteger|null所选窗口中成功结果的平均完成时间,单位毫秒;648000 为 10.8 分钟。不是所有请求的平均耗时。
stats_as_ofinteger|null统计截至时间,Unix 秒级时间戳;暂无统计时间时为 null。
last_activity_atinteger|null最近记录到的调用结果时间,Unix 秒;没有记录时为 null。
statusstringhealthy 正常、degraded 需关注、critical 较低、historical 历史参考、unknown 暂无数据、pending 统计更新中、insufficient 数据积累中。
consistentboolean统计数据是否一致;为 false 时,成功率与平均完成时间为 null。
refresh_interval_secondsinteger统计刷新间隔,单位秒,默认 600。
staleboolean|nulltrue 表示统计数据已延迟,false 表示未延迟;暂无统计时间时为 null。

优先使用近 24 小时的完成结果;无近期结果时使用近 7 天历史数据,并标为 historical。有完成结果即返回实际成功率;null 表示暂无可用值,不能当作 0% 或 100%。

05错误处理

错误响应

情况HTTP响应示例 / 说明
缺少 Authorization401
{"ok":false,"error":"Missing Authorization: Bearer <NewAPI API Key>"}
Key 无效或无权限401 / 403 等根据返回的错误信息检查 Key 是否有效、已过期或受到权限限制。
请求超时504稍后重试。
请求失败502暂时无法获取模型信息,稍后重试。
服务暂时不可用503稍后重试,持续失败时联系服务方。

请同时检查 HTTP 状态和响应内容:即使 HTTP 为 200,success:false 也表示请求失败。不同 Key 的可用模型和价格可能不同,请分别查询。