提交商品图片生成任务
curl --request POST \
--url https://api.ch88.cn/v1/open/product-images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "生成一张简洁高级的护肤品电商主图,产品居中,背景干净,保留真实包装细节。",
"image_urls": [
"https://api.ch88.cn/v1/linggan/media/assets/generated%2Fopen-upload%2Fexample-front.png"
],
"product_info": {
"name": "保湿精华液",
"sellingPoints": "清爽肤感,适合日常保湿",
"platform": "Amazon"
},
"size": "1:1",
"resolution": "1k",
"output_language": "zh-cn"
}
'import requests
url = "https://api.ch88.cn/v1/open/product-images/generations"
payload = {
"prompt": "生成一张简洁高级的护肤品电商主图,产品居中,背景干净,保留真实包装细节。",
"image_urls": ["https://api.ch88.cn/v1/linggan/media/assets/generated%2Fopen-upload%2Fexample-front.png"],
"product_info": {
"name": "保湿精华液",
"sellingPoints": "清爽肤感,适合日常保湿",
"platform": "Amazon"
},
"size": "1:1",
"resolution": "1k",
"output_language": "zh-cn"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '生成一张简洁高级的护肤品电商主图,产品居中,背景干净,保留真实包装细节。',
image_urls: [
'https://api.ch88.cn/v1/linggan/media/assets/generated%2Fopen-upload%2Fexample-front.png'
],
product_info: {name: '保湿精华液', sellingPoints: '清爽肤感,适合日常保湿', platform: 'Amazon'},
size: '1:1',
resolution: '1k',
output_language: 'zh-cn'
})
};
fetch('https://api.ch88.cn/v1/open/product-images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"data": {
"status": "submitted",
"task_id": "task_01K4Y8R6Z1J2X3M4N5P6Q7R8S9"
},
"request_id": "req_550e8400-e29b-41d4-a716-446655440000"
}
{
"error": {
"code": 400,
"type": "invalid_request_error",
"message": "请至少提供 1 张产品图"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 401,
"type": "authentication_error",
"message": "缺少 Public API Key"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 403,
"type": "permission_error",
"message": "成员或组织已停用"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 409,
"type": "conflict_error",
"message": "成员未分配有效上游密钥"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 429,
"type": "rate_limit_error",
"message": "请求过于频繁,请稍后重试",
"retryable": true
},
"request_id": "req_xxx"
}
{
"error": {
"code": 502,
"type": "upstream_error",
"message": "上游服务暂时不可用,请稍后重试",
"retryable": true
},
"request_id": "req_xxx"
}
{
"error": {
"code": 503,
"type": "service_unavailable_error",
"message": "服务暂时不可用,请稍后重试",
"retryable": true
},
"request_id": "req_550e8400-e29b-41d4-a716-446655440000"
}
全部接口
提交商品图片生成任务
提交一项商品图片生成任务。接口只负责接受任务,不会等待图片生成完成。
POST
https://api.ch88.cn
/
v1
/
open
/
product-images
/
generations
提交商品图片生成任务
curl --request POST \
--url https://api.ch88.cn/v1/open/product-images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "生成一张简洁高级的护肤品电商主图,产品居中,背景干净,保留真实包装细节。",
"image_urls": [
"https://api.ch88.cn/v1/linggan/media/assets/generated%2Fopen-upload%2Fexample-front.png"
],
"product_info": {
"name": "保湿精华液",
"sellingPoints": "清爽肤感,适合日常保湿",
"platform": "Amazon"
},
"size": "1:1",
"resolution": "1k",
"output_language": "zh-cn"
}
'import requests
url = "https://api.ch88.cn/v1/open/product-images/generations"
payload = {
"prompt": "生成一张简洁高级的护肤品电商主图,产品居中,背景干净,保留真实包装细节。",
"image_urls": ["https://api.ch88.cn/v1/linggan/media/assets/generated%2Fopen-upload%2Fexample-front.png"],
"product_info": {
"name": "保湿精华液",
"sellingPoints": "清爽肤感,适合日常保湿",
"platform": "Amazon"
},
"size": "1:1",
"resolution": "1k",
"output_language": "zh-cn"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '生成一张简洁高级的护肤品电商主图,产品居中,背景干净,保留真实包装细节。',
image_urls: [
'https://api.ch88.cn/v1/linggan/media/assets/generated%2Fopen-upload%2Fexample-front.png'
],
product_info: {name: '保湿精华液', sellingPoints: '清爽肤感,适合日常保湿', platform: 'Amazon'},
size: '1:1',
resolution: '1k',
output_language: 'zh-cn'
})
};
fetch('https://api.ch88.cn/v1/open/product-images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"data": {
"status": "submitted",
"task_id": "task_01K4Y8R6Z1J2X3M4N5P6Q7R8S9"
},
"request_id": "req_550e8400-e29b-41d4-a716-446655440000"
}
{
"error": {
"code": 400,
"type": "invalid_request_error",
"message": "请至少提供 1 张产品图"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 401,
"type": "authentication_error",
"message": "缺少 Public API Key"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 403,
"type": "permission_error",
"message": "成员或组织已停用"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 409,
"type": "conflict_error",
"message": "成员未分配有效上游密钥"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 429,
"type": "rate_limit_error",
"message": "请求过于频繁,请稍后重试",
"retryable": true
},
"request_id": "req_xxx"
}
{
"error": {
"code": 502,
"type": "upstream_error",
"message": "上游服务暂时不可用,请稍后重试",
"retryable": true
},
"request_id": "req_xxx"
}
{
"error": {
"code": 503,
"type": "service_unavailable_error",
"message": "服务暂时不可用,请稍后重试",
"retryable": true
},
"request_id": "req_550e8400-e29b-41d4-a716-446655440000"
}
{
"code": 200,
"data": {
"status": "submitted",
"task_id": "task_01K4Y8R6Z1J2X3M4N5P6Q7R8S9"
},
"request_id": "req_550e8400-e29b-41d4-a716-446655440000"
}
{
"error": {
"code": 400,
"type": "invalid_request_error",
"message": "请至少提供 1 张产品图"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 401,
"type": "authentication_error",
"message": "缺少 Public API Key"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 403,
"type": "permission_error",
"message": "成员或组织已停用"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 409,
"type": "conflict_error",
"message": "成员未分配有效上游密钥"
},
"request_id": "req_xxx"
}
{
"error": {
"code": 429,
"type": "rate_limit_error",
"message": "请求过于频繁,请稍后重试",
"retryable": true
},
"request_id": "req_xxx"
}
{
"error": {
"code": 502,
"type": "upstream_error",
"message": "上游服务暂时不可用,请稍后重试",
"retryable": true
},
"request_id": "req_xxx"
}
{
"error": {
"code": 503,
"type": "service_unavailable_error",
"message": "服务暂时不可用,请稍后重试",
"retryable": true
},
"request_id": "req_550e8400-e29b-41d4-a716-446655440000"
}
授权
成员级 Public API Key。请填写完整密钥,Mintlify Playground 会自动以 Authorization: Bearer <PUBLIC_API_KEY> 发送。完整明文只在管理后台创建成功时显示一次。
请求体
application/json
生图要求。建议写明主体、用途、场景、构图、视觉风格、文字语言和禁止项。
Required string length:
1 - 3000商品图或参考图 URL。当前商品生图接口至少需要 1 张、最多 15 张。
Required array length:
1 - 15 elements已知的结构化商品信息。所有数据应来自客户资料或可确认事实。
Hide child attributes
Hide child attributes
商品名称。
可确认的核心卖点。
使用方式或适用场景。
销售国家或地区。
销售平台。
期望的视觉风格。
其他需要在生图中考虑的事实或约束。
模型生成画布比例。除 auto 外支持 15 个固定比例;1K、2K、4K 均支持这些比例。
可用选项:
auto, 1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 2:1, 1:2, 3:1, 1:3, 21:9, 9:21 输出分辨率档位。更高分辨率通常需要更长处理时间。
可用选项:
1k, 2k, 4k 图片中文字的目标语言。枚举值与语言对应关系:
no-text:无文字(纯视觉)thai:泰语indonesian:印度尼西亚语vietnamese:越南语malay:马来语zh-cn:简体中文english:英语japanese:日语korean:韩语filipino:菲律宾语zh-tw:繁体中文french:法语spanish:西班牙语german:德语italian:意大利语portuguese:葡萄牙语russian:俄语arabic:阿拉伯语
可用选项:
no-text, thai, indonesian, vietnamese, malay, zh-cn, english, japanese, korean, filipino, zh-tw, french, spanish, german, italian, portuguese, russian, arabic 响应
查询任务结果
任务提交成功后返回 data.task_id。请保存该任务编号,并通过 GET /v1/open/tasks/{task_id} 轮询任务状态,详见查询生图任务。

