查询模型参数 spec
返回指定 model 在 /api/generate/submit 上接受的字段契约(类型 / 枚举 / 范围 / 上限 / 必填 / 别名 / 位置)。
SDK / playground / 文档站可以用本接口做参数表单的自动渲染:把 spec 的每个 field 直接映射成 UI 控件(select / number / array input),并在提交前用同一份规则做客户端校验。
接口无需鉴权。响应中的 pricing 实时读取计费配置,使用 currency: "USD",通过 billing_unit 区分按秒、按张、按次。base_price 为未应用请求倍率、分组倍率的基础单价;base_unit 表示尚未确定完整的计费单位。
precharge 仅表示任务预扣额度,不是 token 单价或最终结算费用。动态计费返回 billing_expr 和 expression_usd_multiplier;能够以仅含 model 的请求体求值时,额外返回 default_estimate,它不保证省略其他参数的生成请求有效。用量、请求头和时间相关表达式不提供默认估价。实际费用还受请求倍率、用户分组和最终结算影响。
status: "unverified_default" 表示价格与已知占位值相同,需要确认;unconfigured 表示未找到配置,invalid 表示配置无效。缺少金额字段不能当作免费。可核对的缺失或占位价格会补充 reference(黄金参考价、核对日期、单位和档位),其中 applied_to_billing: false,仅供参考,不修改扣费配置。档位标签不是额外支持的请求参数。运行时配置包含已合并的默认值,无法单凭来源字段判断管理员是否显式确认过价格。
display_name 和 description 分别提供模型家族的展示名称和用途简介,均包含 zh、en。modality 表示输出媒体类型(image、video、audio,未知时为 unknown),不表示输入类型。同一契约的别名共享家族描述,实际调用仍使用所选 model ID。单模型和模型列表均返回这些信息,具体参数限制以 fields 为准。
调用案例
examples 可直接用于文档、SDK 示例和 mock 请求数据。每个案例包含:
name:稳定的案例标识,例如text_to_image、reference_to_video。request:提交方法、路径、请求头和完整 JSON 请求体;model保留查询时的模型名或别名。response:提交成功的 HTTP 状态码和响应体,任务状态为not_started。result.request/result.response:查询任务的方法和路径,以及状态为finished的结果示例(含files)。synthetic: true:明确标识这是合成数据。
将 Authorization 中的 YOUR_API_KEY 替换为自己的密钥;参考素材 URL 也需要替换成可访问的地址。示例任务 ID 和结果 URL 仅为占位值,不能直接查询或下载。示例不包含报价,也不代表任务的真实耗时或结果。实际提交仍需鉴权,并遵循账户的正常计费规则。
所有注册模型提供最小文字请求案例;支持公开 images 字段且通过契约校验的模型还提供参考图案例。案例不是全部支持模式的清单。mock 与案例共享媒体类型和响应结构,mock 测试直接复用这些请求;mock 的实际任务 ID 和媒体地址仍由执行流程生成。
Path Parameters
model 名称。和 /api/generate/submit 请求体里写的一致。
Response Body
application/json
application/json
curl -X GET "https://api.apimp.ai/api/generate/spec/seedance-2.0-text-to-video"{
"code": 200,
"data": {
"id": "seedance-2.0",
"pricing": {
"model": "seedance-2.0",
"status": "unverified_default",
"billing_mode": "model_price",
"currency": "USD",
"billing_unit": "base_unit",
"source": "runtime_config",
"quota_per_usd": 500000,
"group_ratio": 1,
"reference_only": true,
"base_price": 0.1,
"reference": {
"source": "gold_reference",
"checked_at": "2026-09-30",
"currency": "USD",
"billing_unit": "second",
"applied_to_billing": false,
"tiers": [
{
"variant": "480P",
"unit_price": 0.066
},
{
"variant": "480P-input",
"unit_price": 0.04
},
{
"variant": "720P",
"unit_price": 0.142
},
{
"variant": "720P-input",
"unit_price": 0.08584
},
{
"variant": "1080P",
"unit_price": 0.3544
},
{
"variant": "1080P-input",
"unit_price": 0.21568
},
{
"variant": "4K",
"unit_price": 0.722
},
{
"variant": "4K-input",
"unit_price": 0.44432
}
]
}
},
"default_action": "generate",
"fields": {
"prompt": {
"location": "top_level",
"type": "string"
},
"size": {
"location": "top_level",
"type": "string",
"enum": [
"16:9",
"9:16",
"1:1",
"4:3",
"3:4",
"21:9",
"adaptive"
]
},
"duration": {
"location": "top_level",
"type": "int",
"min": 4,
"max": 15,
"aliases": [
"seconds"
]
},
"images": {
"location": "top_level",
"type": "string_array",
"max_items": 9
},
"quality": {
"location": "metadata",
"type": "string",
"enum": [
"480p",
"720p",
"1080p"
]
},
"generate_audio": {
"location": "metadata",
"type": "bool"
}
}
}
}{
"code": 404,
"error": {
"message": "no spec registered for model `xyz-unknown`",
"type": "not_found"
}
}这篇文档对您有帮助吗?
最后更新于