API REF
模型详情
查询单个模型的完整信息,包括该模型支持的可调参数定义(parameters),用于在提交生成任务时正确构造 params。
接口基本信息
| 项目 | 说明 |
|---|---|
| 接口用途 | 查询单个模型的详情与可调参数定义 |
| 请求方式 | GET https://api.mozhiai.net/v1/models/:id |
| 认证方式 | Authorization: Bearer YOUR_API_KEY |
| 路径参数 | id — 模型 ID(字符串形式的数字 ID) |
响应示例
Response
{
"code": 0,
"message": "ok",
"data": {
"id": "1234567890",
"display_name": "Seedream 4.0",
"slug": "seedream-4-0",
"model_types": ["image"],
"capability_tags": ["文生图", "图生图"],
"icon": "https://cos.mozhiai.net/icons/seedream.png",
"description": "豆包图像生成模型",
"sort_weight": 100,
"provider_model_name": "doubao-seedream-4-0-250828",
"usage_doc_html": null,
"input_placeholder": "描述你想生成的画面…",
"parameters": [
{
"id": "201",
"label": "图片尺寸",
"param_key": "size",
"description": "生成图片的分辨率",
"widget_type": "select",
"is_required": true,
"default_value": "1024x1024",
"max_count": 0,
"applicable_features": [],
"sort_weight": 10,
"options": [
{ "label": "1024x1024", "value": "1024x1024" },
{ "label": "2048x2048", "value": "2048x2048" }
]
}
],
"parameter_links": []
},
"trace_id": "..."
}响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
id / display_name / slug / model_types / capability_tags / icon / description / sort_weight | — | 与模型列表接口一致 |
provider_model_name | string | 上游厂商侧的模型名(排查问题时参考) |
usage_doc_html | string | 模型使用说明(HTML),可能为空 |
input_placeholder | string | 输入提示语,可能为空 |
parameters | object[] | 可调参数定义,见下表 |
parameter_links | object[] | 参数间联动规则 |
parameters 字段(参数定义)
| 字段 | 类型 | 说明 |
|---|---|---|
param_key | string | 参数名——提交任务时 params 对象里的键 |
label | string | 参数展示名 |
description | string | 参数说明 |
widget_type | string | 控件类型(如 select / input / slider),提示取值方式 |
is_required | bool | 是否必填 |
default_value | any | 默认值,不传参数时生效 |
max_count | int | 多值参数的最大个数,0 表示不限 |
options | object[] | 可选项列表(label / value),select 类参数使用 |
applicable_features | string[] | 参数适用的功能场景 |
sort_weight | int | 展示排序权重 |
提交任务时,把要覆盖的参数按 { "<param_key>": <value> } 形式放进 params 即可,见 提交生成任务。
错误码
| HTTP | 错误码 | 说明 |
|---|---|---|
| 400 | 100001 | 路径参数不是合法的模型 ID |
| 401 | 190002 | API Key 缺失、无效或已吊销 |
| 404 | 130001 | 模型不存在或已下线 |
调用示例
cURL
curl https://api.mozhiai.net/v1/models/1234567890 \
-H "Authorization: Bearer $MOZHIAI_API_KEY"