调用流程
/v1/models只读请求,不需要请求体。
id、owned_by、supported_endpoint_types。model_info 读取能力和定价信息。查询模型信息不扣费。生成视频或图片请使用对应的任务接口。
GET /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"]
成功响应: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"]
}
}
]
}
顶层返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
object | string | 固定为 list。 |
success | boolean | 成功时为 true;为 false 时请按错误响应处理。 |
data | array | 模型对象数组。按模型 ID 排序;可能为空数组。 |
模型基础字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 模型唯一 ID。提交生成任务时通常使用此值作为模型名称。 |
object | string | 固定为 model。 |
created | number | 模型创建时间,Unix 秒级时间戳。 |
owned_by | string | 模型所属方。 |
supported_endpoint_types | string[] | 支持的接口类型,例如 ["openai"]。 |
model_info | object | 模型能力、价格、素材限制和统计信息。 |
model_info 扩展字段
| 字段 | 类型 | 示例 | 说明 |
|---|---|---|---|
display_name | string | sdas-qd-seedance-2.5-480p | 模型展示名称。 |
modality | string | video | 模型类别。当前支持 video、image、other。 |
description | string|null | null | 模型描述,没有说明时为 null。 |
resolution | string|null | 480p | 分辨率,例如 480p、720p、1080p、4k。 |
type | string|null | s2.5 | 模型类型标签,例如 s2.0满血、s2.0fast、s2.0mini。 |
supports_real_person | boolean|null | true | 是否支持真人内容。false 表示不支持,null 表示暂无信息。 |
billing_mode | string|null | per_request | per_request 表示按次,per_second 表示按秒。 |
duration | object|null | {min,max,step} | 允许的生成时长。连续范围和离散枚举见下方说明。 |
price | number|null | 9.6 | 模型原价单价,未乘个人倍率;暂无价格时为 null。 |
model_ratio | number|null | 0.85 | 当前 Key 对此模型的有效倍率。倍率不唯一或未查到时为 null;0 是有效倍率。 |
final_price | number|null | 8.16 | 倍率后展示单价,即 price × model_ratio。没有基础价或确定倍率时为 null,不是实际扣款金额。 |
pricing_source | string|null | legacy_group | legacy_group:分组计价;user_custom:用户专属计价;暂无倍率时为 null。 |
group_ratio_ignored | boolean|null | false | true 表示专属模式,忽略分组倍率,不能再叠乘;未查到此模型倍率时为 null。 |
model_ratio_range | object|null | {"min":0.333,"max":1} | 适用倍率不唯一时的最小、最大倍率;确定倍率或暂无倍率时为 null。 |
final_price_range | object|null | {"min":3.1968,"max":9.6} | 基础价分别乘最小、最大倍率的展示范围;没有基础价或倍率范围时为 null。 |
statistics | object|null | {"success_rate":98.5,...} | 模型成功率、平均完成时间及更新时间,见下方统计字段说明;统计暂不可用时为 null。 |
currency | string|null | CNY | 价格币种,例如 CNY。 |
references | object|null | {images:30,...} | 素材数量上限,分别统计图片、视频、音频。 |
aspect_ratios | string[] | ["1:1", "16:9"] | 支持的画面比例列表。 |
扩展字段的读取规则
时长 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_rate | number|null | 成功率百分数,98.5 表示 98.50%;0 是真实的 0%。有完成结果即返回实际成功率;无数据或统计不一致时为 null。 |
window_hours | integer | 24 为近 24 小时;近期无完成结果时以 168 表示近 7 天历史;0 为无可用窗口。 |
avg_completion_ms | integer|null | 所选窗口中成功结果的平均完成时间,单位毫秒;648000 为 10.8 分钟。不是所有请求的平均耗时。 |
stats_as_of | integer|null | 统计截至时间,Unix 秒级时间戳;暂无统计时间时为 null。 |
last_activity_at | integer|null | 最近记录到的调用结果时间,Unix 秒;没有记录时为 null。 |
status | string | healthy 正常、degraded 需关注、critical 较低、historical 历史参考、unknown 暂无数据、pending 统计更新中、insufficient 数据积累中。 |
consistent | boolean | 统计数据是否一致;为 false 时,成功率与平均完成时间为 null。 |
refresh_interval_seconds | integer | 统计刷新间隔,单位秒,默认 600。 |
stale | boolean|null | true 表示统计数据已延迟,false 表示未延迟;暂无统计时间时为 null。 |
优先使用近 24 小时的完成结果;无近期结果时使用近 7 天历史数据,并标为 historical。有完成结果即返回实际成功率;null 表示暂无可用值,不能当作 0% 或 100%。
错误响应
| 情况 | HTTP | 响应示例 / 说明 |
|---|---|---|
| 缺少 Authorization | 401 | |
| Key 无效或无权限 | 401 / 403 等 | 根据返回的错误信息检查 Key 是否有效、已过期或受到权限限制。 |
| 请求超时 | 504 | 稍后重试。 |
| 请求失败 | 502 | 暂时无法获取模型信息,稍后重试。 |
| 服务暂时不可用 | 503 | 稍后重试,持续失败时联系服务方。 |
请同时检查 HTTP 状态和响应内容:即使 HTTP 为 200,success:false 也表示请求失败。不同 Key 的可用模型和价格可能不同,请分别查询。