查询图片模型规范
截至 2026 年 11 月 21 日,图片模型规范已经在 img.e6t.cn 开放,可读取模型的尺寸、质量、数量和参考图限制。模型清单与可用性会变化,应按接口实时结果展示,不要固定模型数量。
查询地址
GET https://img.e6t.cn/v1/specs/image查询不需要 API Key 或登录 Cookie。指定模型时,只传一个非空 model 参数:
curl --fail-with-body --get 'https://img.e6t.cn/v1/specs/image' \
--data-urlencode 'model=YOUR_IMAGE_MODEL_ID'先查全部规范,再从 data[].model 复制完整名称。规范中的名称是网关对外名称;正式站账户能否调用、是否存在模型映射,仍要核对控制台模型列表和当前 Key 的权限。
| 用途 | 地址 | 鉴权 |
|---|---|---|
| 读取参数规范 | https://img.e6t.cn/v1/specs/image | 无需密钥 |
| 正式站创建与查询图片任务 | https://api.e6t.cn | 正式站生成 API Key |
旧 media.e6t.cn/v1/specs/image 与 api.e6t.cn/v1/specs/image 不是当前公开规范入口。不要直接替换这几个域名,也不要把正式站 Key 当作网关 Key。
返回结构
全部查询和单模型查询都返回 data 数组,结构版本当前为字符串 "3"。以下为结构示例,具体值从实时接口读取:
{
"schema_version": "3",
"data": [
{
"model": "YOUR_IMAGE_MODEL_ID",
"type": "image",
"available": true,
"endpoints": {
"generation": "/v1/images/generations",
"edit": "/v1/images/edits"
},
"parameters": {
"n": {"required": false, "max": null},
"size": {"required": false, "values": [], "validation": "upstream", "notes": ""},
"quality": {"required": false, "values": []},
"background": {"values": [], "validation": "upstream", "notes": ""},
"output_format": {"values": [], "validation": "upstream", "notes": ""}
},
"references": {"images": {"max_count": 16}},
"prompt": {"required": true, "max_bytes": null}
}
]
}字段含义与边界
| 字段 | 使用方式 |
|---|---|
available | 网关是否配置可用渠道;不是当前 Key 的权限证明,也不是实时健康保证 |
endpoints | 相对创建路径;图生图是否可用还要检查参考图上限 |
prompt.max_bytes | 提示词 UTF-8 字节上限,不是字符数量 |
parameters.n.max | 单任务输出图片数量上限 |
parameters.*.values | 参数候选值;空数组表示没有公开固定候选集合,不表示支持任意值 |
validation: upstream | 参数值及实际效果由对应渠道处理,不保证传入就会转换成功 |
references.images.max_count | 输入参考图数量,与输出数量 n 无关 |
参考图上限为 0 表示不支持参考图,为 null 表示未配置模型级上限。提示词或生成数量上限为 null 或 0 时,不应生成“无限制”的提示;基础接口和渠道限制仍然有效。required: false 表示可以省略,不需要自动填入候选列表第一项。
response_format: url 指结果交付方式,output_format 指文件编码,二者不能替代。
在程序中读取
async function getImageModelSpec(model) {
const url = new URL('https://img.e6t.cn/v1/specs/image');
url.searchParams.set('model', model);
const response = await fetch(url, { credentials: 'omit' });
if (!response.ok) throw new Error(`Specification HTTP ${response.status}`);
const body = await response.json();
if (body.schema_version !== '3' || !Array.isArray(body.data)) {
throw new Error('Unsupported specification structure');
}
const spec = body.data.find((item) => item.model === model);
if (!spec) throw new Error('No published specification for this model');
return spec;
}规范读取不需要跟随每次任务查询执行。按完整 URL 缓存并遵循响应头;收到 304 时复用缓存,不解析空响应。读取失败时保留已有配置,并提示规范待更新。
400 通常需要检查查询参数,404 应核对模型名称和是否公开规范,429 按重试提示降低频率,503 可稍后重试。规范查询不会创建图片任务或返回账户价格。