接口路径从 /api/openapi/ 开始,拼在这个域名后面
标准化 RESTful 协议设计。支持服务端直接调用与 Webhook 异步回调通知,支持多语言快速接入。
https://dhd.douhuiai.com接口路径从 /api/openapi/ 开始,拼在这个域名后面
只使用控制台创建的密钥
按模型规格扣 API 积分
在 API 密钥页创建 dhk_ 密钥,放在请求头里。
没有自己的图床时,先调用图片上传,拿到可访问地址再提交任务。
图像任务异步受理,返回 uuid。提示词工具同步返回文案。
给密钥配置回调地址,或用 uuid 轮询任务状态。
请求头必须是 Authorization: Bearer dhk_ 开头的密钥。密钥在控制台创建,列表默认打码,登录后可再次查看完整密钥。请只放在服务端,不要写入前端、安装包或仓库。
业务接口使用 application/json。图片上传使用 multipart/form-data,文件字段名是 file。
回调地址写在对应密钥上,不放在单次请求体里。任务完成时 POST 到该地址;密钥没填时,才使用账户上的回调地址。
密钥只能放在服务端,不要写进浏览器、App 安装包或仓库。
POST /api/openapi/smartimg HTTP/1.1 Host: dhd.douhuiai.com Authorization: Bearer dhk_你的密钥 Content-Type: application/json
所有接口均采用标准 JSON 响应体,根据 status 字段判定执行状态:
status可选msg可选uuid可选wait_time可选task_uuid可选zh / en可选{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}图片生成完成或最终失败时通知一次。排队中的进度不会回调。
POST,Content-Type 为 application/json。请返回 HTTP 200。
优先使用本次扣费密钥上的回调地址。该密钥没有填写时,使用账户回调地址。
同一 uuid 可能因重试再次通知。请按 uuid + code 去重。
code可选uuid可选msg可选appid可选grid可选imglist可选{
"code": 200,
"uuid": "a1b2c3d4e5",
"msg": "出图完成",
"appid": "your_appid",
"grid": "https://img2.douhuiai.com/dhimg/2026/09/demo_grid.jpg",
"imglist": [
"https://img2.douhuiai.com/dhimg/2026/09/demo.png"
]
}{
"code": 500,
"uuid": "a1b2c3d4e5",
"msg": "出图失败",
"appid": "your_appid"
}POST /api/openapi/upload
jpg、jpeg、png、webp,最大 15MB。字段名 file。
返回的 filename 拼成 https://img2.douhuiai.com/dhimg/{filename},再填进 inputImg 或 inputImgs。
上传的文件仅暂存7天,过期自动删除。
file可选status可选filename可选width / height可选msg可选curl -X POST "https://dhd.douhuiai.com/api/openapi/upload" \ -H "Authorization: Bearer dhk_你的密钥" \ -F "file=@./product.jpg"
{
"status": 200,
"filename": "apiupd/20260930/xxxx.jpg",
"width": 1024,
"height": 1024,
"msg": "上传的文件仅暂存7天,过期自动删除"
}POST /api/openapi/refine,同步返回,不产生图片任务。
与站内「AI润色」同一套逻辑。按创作类型和参考图扩写描述词,成功字段是 result。
2积分/次,从 API 积分扣除。
prompt可选type可选imgurl可选imgurl_2可选imgurl_3可选ctlImgs可选subType可选tplid可选status可选result可选curl -X POST "https://dhd.douhuiai.com/api/openapi/refine" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "一条细链项链,几何吊坠,浅灰背景的电商主图",
"type": "smartimg",
"ctlImgs": [
"https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png"
]
}'{
"status": 200,
"result": "一条细链项链,几何吊坠居中,浅灰背景,柔和棚拍光,金属边缘清晰……"
}POST /api/openapi/task
没有回调,或需要主动核对结果时,用提交返回的 uuid 查询。
uuid 还没有对应作品或批量任务时,status 为 -200,msg 为「任务未开始」。请稍后重试。
uuid必填status可选msg可选data可选curl -X POST "https://dhd.douhuiai.com/api/openapi/task" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{"uuid":"a1b2c3d4e5"}'{
"status": 200,
"msg": "获取成功",
"data": {
"uuid": "a1b2c3d4e5",
"progress": 100,
"state": "success",
"total_count": 2,
"done_count": 2,
"fail_count": 0,
"images": [
"https://img2.douhuiai.com/dhimg/img/demo-1.png",
"https://img2.douhuiai.com/dhimg/img/demo-2.png"
]
}
}{
"status": 200,
"msg": "获取成功",
"data": {
"uuid": "a1b2c3d4e5",
"progress": 50,
"state": "running",
"total_count": 2,
"done_count": 1,
"fail_count": 0,
"images": [
"https://img2.douhuiai.com/dhimg/img/demo-1.png"
]
}
}POST /api/openapi/balance
只返回积分。points 是当前可用积分,total 是累计充值积分。
data.points可选data.total可选curl -X POST "https://dhd.douhuiai.com/api/openapi/balance" \ -H "Authorization: Bearer dhk_你的密钥"
{
"status": 200,
"msg": "ok",
"data": {
"points": 1250,
"total": 5000
}
}智能出图、万能改图,以及文生图、N-banana、多图融合、白模、线稿、一键场景/卖点/试穿/细节、款式融合、文字出款、产品设计、概念图、彩平、毛坯、3D 渲染、线稿渲染这些接口,imgNum 为 1 到 20,默认 1。模型单次只能出更少张时,服务端拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号,用它轮询。图片编辑器的模型出图也是 1 到 20;裁剪、转线稿、标准去污和标准扩图仍是 1、2 或 4,不支持 3。商品图编辑、效果图后期、换发型是 1、2 或 4,不支持 3。Flux、相似图、风格更换、真人转漫画是 1、2、3 或 4。固定 1 张的接口没有 imgNum。
预设为 1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。qwen3 另支持 7:9、9:7、9:21,不支持 4:5、5:4。nano-banana、nano-banana-2、nano-banana-2.1、nano-banana-pro 只能传预设比例,不能传自定义宽高。
只有 gpt-image-2、gpt-image-2.5、Seedream、wan2.7、qwen3 可以自定义。sizeMode 必须传 custom,ratio 传宽x高,x 为小写,宽和高都是正整数,例如 1024x1536。最终出图像素就是这两个数,不会再按 resolution 放大或缩小。resolution 仍要传该模型允许的档位。
宽和高都必须是 16 的倍数。单边不超过 3840。宽/高在 1/3 到 3 之间,也就是 1:3 到 3:1。总像素 655360 到 8294400。例如 1024x1536 可以,1000x1500 不行。
宽/高在 1/16 到 16 之间。seedream4、seedream5Pro:总像素 921600 到 16777216。seedream4.5、seedream5:总像素 3686400 到 16777216。低于下限或高于 16777216 会直接拒绝。
宽和高都必须是 8 的倍数。宽/高在 1/8 到 8 之间。总像素至少 589824(768×768)。wan2.7:单边不超过 2048,总像素不超过 4194304(2048×2048)。wan2.7-pro 没有参考图:单边不超过 4096,总像素不超过 16777216(4096×4096)。wan2.7-pro 有参考图:单边不超过 2048,总像素不超过 4194304。
qwen3 与 qwen3-pro 相同。宽和高都必须是 8 的倍数。宽/高在 1/8 到 8 之间。总像素 262144(512×512)到 4194304(2048×2048)。
有参考图时,sizeMode 传 origin,ratio 传原图的宽x高。服务端按该模型的比例范围和所选 resolution 换算输出尺寸。原图宽高比超出该模型上限时会直接拒绝:gpt-image-2 与 2.5 为 1:3 到 3:1,Seedream 为 1:16 到 16:1,wan2.7 与 qwen3 为 1:8 到 8:1。
gpt-image-2、gpt-image-2.5、nano-banana-2、nano-banana-2.1、nano-banana-pro 为 1K、2K、4K,按分辨率计费。nano-banana(1.0)按当前标价计费,未配置则拒绝。seedream4 与 seedream4.5 为 2K、4K。seedream5 为 2K、3K。seedream5Pro 与 qwen3 为 1K、2K。不支持的档位会直接报错。
gpt-image-2gpt21-201K / 2K / 4K16 的倍数;单边≤3840;1:3~3:1;总像素 655360~8294400gpt-image-2.5version=flare 或 sunburst1-201K / 2K / 4K与 gpt-image-2 相同nano-bananabanana1-201K / 2K / 4K仅预设,不支持自定义宽高nano-banana-2banana21-201K / 2K / 4K仅预设,不支持自定义宽高nano-banana-2.1banana2.11-201K / 2K / 4K仅预设,不支持自定义宽高nano-banana-probananaPro1-201K / 2K / 4K仅预设,不支持自定义宽高seedream-4 / 4.5 / 5 / 5-proseedream4、seedream4.5、seedream5、seedream5Pro1-204/4.5:2K、4K;5:2K、3K;5 Pro:1K、2K1:16~16:1。4 / 5 Pro:921600~16777216。4.5 / 5:3686400~16777216wan2.7 / wan2.7-pro通义万相1-201K / 2K / 4K。有参考图时只传 1K 或 2K8 的倍数;1:8~8:1;总像素≥589824。2.7 单边≤2048。Pro 无参考图单边≤4096,有参考图单边≤2048qwen3 / qwen3-pro通义千问图像1-201K / 2K8 的倍数;1:8~8:1;总像素 262144~4194304。参考图最多 3 张/api/openapi/smartimgprompt必填model必填version可选channel可选resolution可选imgNum可选ratio可选sizeMode可选inputImgs可选autoOptimize可选imgNum 为 1 到 20。超过模型单次张数时返回批量任务 uuid,用任务查询看整批进度。
参考图请先上传,或传公网可访问的 URL。
curl -X POST "https://dhd.douhuiai.com/api/openapi/smartimg" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "以这双沙滩鞋为商品主体,生成电商主图:鞋子完整居中,浅灰渐变背景,柔和棚拍光,鞋面编织和厚底边缘清晰,不改变鞋型和配色。",
"model": "gpt-image-2",
"resolution": "1K",
"imgNum": 1,
"ratio": "1:1",
"sizeMode": "smart",
"inputImgs": [
"https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png"
]
}'{
"status": 200,
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/editimagetool必填inputImg必填inputImgs可选imgNum可选prompt可选maskImg可选model可选resolution可选ratio可选sizeMode可选version可选channel可选裁剪、抠图、去色、去水印等本地处理类功能不需要模型参数。
局部修改、万物消除、万物替换需要 maskImg 标出区域。
curl -X POST "https://dhd.douhuiai.com/api/openapi/editimage" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"tool": "upscale",
"inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
"imgNum": 1,
"resolution": "2K"
}'{
"status": 200,
"uuid": "b2c3d4e5f6",
"wait_time": 20
}/api/openapi/smarteditprompt必填inputImg必填inputImgs可选model可选version可选resolution可选imgNum可选ratio可选sizeMode可选refImg可选channel可选imgNum 为 1 到 20。超过 1 张时按子任务拆开。
批量时每张输入图单独成任务,完成时各自回调。
curl -X POST "https://dhd.douhuiai.com/api/openapi/smartedit" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "保持这双沙滩鞋的鞋型、编织鞋面和配色不变,把背景换成干净的浅灰色棚拍背景,地面保留柔和投影。",
"inputImg": "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
"model": "gpt-image-2",
"resolution": "1K",
"imgNum": 1,
"ratio": "1:1",
"sizeMode": "smart"
}'{
"status": 200,
"uuid": "c3d4e5f6a7",
"wait_time": 40
}/api/openapi/prompttool必填inputImg可选inputImgs可选prompt可选videoUrl可选videoMode可选反推、指令和视频反推成功时读 zh 或 en,没有 uuid。
tool=refine 与 POST /api/openapi/refine 相同,成功字段是 result。
curl -X POST "https://dhd.douhuiai.com/api/openapi/prompt" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"tool": "reverse",
"inputImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg"
}'{
"status": 200,
"zh": "一条细链项链,几何吊坠,浅灰背景,柔和棚拍",
"en": "a fine-chain necklace with a geometric pendant, light gray background, soft studio light"
}/api/openapi/layereditorinputImg必填tool可选resolution可选prompt可选splitMode可选boxes可选结果通过任务 uuid 查询。导出 PSD 在拆层完成后进行。
curl -X POST "https://dhd.douhuiai.com/api/openapi/layereditor" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png",
"tool": "layersplit",
"resolution": "1K",
"splitMode": "auto",
"prompt": "按帆布包的包身、提手和印花拆层"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/text2imgproprompt必填ratio可选inputImg可选styleRef1可选styleRef2可选faceImg可选mode可选resolution可选speed可选channel可选固定出 4 张,没有 imgNum。
curl -X POST "https://dhd.douhuiai.com/api/openapi/text2imgpro" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "一只家猫坐在窗边,午后侧光,毛发细节清楚,背景虚化,摄影感",
"inputImg": "https://img2.douhuiai.com/dhimg/img/202603/69b52ea4e1303.jpg",
"mode": "7",
"ratio": "3:4",
"speed": "fast",
"channel": "dedicated"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/nanoimgprompt必填inputImgs可选model可选imgNum可选resolution可选ratio可选channel可选curl -X POST "https://dhd.douhuiai.com/api/openapi/nanoimg" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "参考这张帆布包设计图,生成正面产品图:包身图案和配色保持一致,纯白背景,底部有轻微投影。",
"inputImgs": [
"https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png"
],
"model": "bananaPro",
"imgNum": 1,
"resolution": "2K",
"ratio": "1:1",
"channel": "normal"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/repaintinginputImg必填prompt可选refImg可选imgNum可选resolution可选ratio可选model可选curl -X POST "https://dhd.douhuiai.com/api/openapi/repainting" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png",
"prompt": "保持清洗机的机身结构和按键布局,提高清晰度和材质质感,背景仍为浅色棚拍。",
"model": "gpt2",
"imgNum": 1,
"resolution": "2K",
"ratio": "1:1"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/txt2imgprompt必填model可选mode可选imgNum可选resolution可选ratio可选sizeMode可选refImg可选channel可选speed可选不传 model 时按页面默认 GPT image-2、1K。
model=flux 是页面的 Flux(原版),每张 8 积分。
curl -X POST "https://dhd.douhuiai.com/api/openapi/txt2img" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "女赛车手半身肖像,赛车头盔夹在臂弯,赛道灯光虚化,电影感侧光",
"model": "gpt2",
"imgNum": 1,
"resolution": "1K",
"ratio": "3:4",
"sizeMode": "smart",
"refImg": "https://img2.douhuiai.com/dhimg/img/202607/6a58a216b92d6.png"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/sdprompt必填modelId可选inputImg可选ctlId可选ctlSth可选loraIds可选paintStyle可选refImg可选refSth可选refImg2可选refSth2可选faceImg可选faceSth可选ratio可选imgNum可选每张 8 积分。
底模、控制图、模板、画风、参考图和脸部参考都与网站 SDXL 创作页一致。
curl -X POST "https://dhd.douhuiai.com/api/openapi/sd" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "白色棚拍背景,帆布包居中,保留包身印花和提手",
"imgNum": 1,
"ratio": "1:1"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/fluxprompt必填modelId可选inputImg可选ctlId可选ctlSth可选loraIds可选paintStyle可选refImg可选refSth可选refImg2可选refSth2可选faceImg可选faceSth可选ratio可选imgNum可选每张 8 积分。
底模、控制图、模板、画风、参考图和脸部参考都与网站 Flux 创作页一致。
curl -X POST "https://dhd.douhuiai.com/api/openapi/flux" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "白色棚拍背景,帆布包居中,保留包身印花和提手",
"imgNum": 1,
"ratio": "1:1"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/imgrefinedinputImg必填prompt可选curl -X POST "https://dhd.douhuiai.com/api/openapi/imgrefined" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
"prompt": "保留瓶身logo和膏体,提升瓶身高光和标签清晰度"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/blenderinputImgs必填prompt可选model可选imgNum可选resolution可选ratio可选sizeMode可选curl -X POST "https://dhd.douhuiai.com/api/openapi/blender" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImgs": [
"https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
"https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png"
],
"prompt": "让女性模特佩戴这条项链,项链造型和人物五官都保持原样,棚拍半身构图",
"model": "Flux",
"imgNum": 1,
"resolution": "1K",
"ratio": "3:4",
"sizeMode": "smart"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/imagevariantsinputImg必填prompt可选imgNum可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/imagevariants" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202603/69b52ea4e1303.jpg",
"prompt": "同一只猫,改成坐姿侧脸,窗边自然光,不改变花色",
"imgNum": 2,
"ratio": "1:1"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/productblendinputImg必填refImg可选prompt可选curl -X POST "https://dhd.douhuiai.com/api/openapi/productblend" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png",
"prompt": "把清洗机放进整洁的家用清洁场景,机器外形和配色不变,地面有真实接触阴影"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/multiangleinputImg必填prompt可选mode可选resolution可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/multiangle" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
"prompt": "同一条项链,改为45度斜上方视角,吊坠完整可见",
"resolution": "1K",
"ratio": "1:1"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/productrmbginputImgs必填curl -X POST "https://dhd.douhuiai.com/api/openapi/productrmbg" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImgs": [
"https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
"https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
"https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png"
]
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/whitemodelinputImg必填prompt可选mode可选imgNum可选resolution可选ratio可选model可选curl -X POST "https://dhd.douhuiai.com/api/openapi/whitemodel" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png",
"prompt": "按这台清洗机的结构生成白模产品渲染,保留机身比例和手柄位置,浅灰背景",
"imgNum": 1,
"resolution": "2K",
"ratio": "1:1"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/lineinputImg必填prompt可选mode可选imgNum可选resolution可选ratio可选model可选curl -X POST "https://dhd.douhuiai.com/api/openapi/line" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png",
"prompt": "把帆布包设计图渲染成彩色产品图,保留包型和印花轮廓",
"mode": "smart",
"imgNum": 1,
"resolution": "1K",
"ratio": "1:1"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/styletransforminputImg必填prompt可选refImg可选imgNum可选resolution可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/styletransform" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
"prompt": "保持鞋型,把鞋面材质改成帆布印花,配色参考第二张设计图",
"refImg": "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png",
"imgNum": 1,
"resolution": "1K",
"ratio": "1:1"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/text2transimgprompt必填inputImg可选imgNum可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/text2transimg" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "把这条项链做成透明背景的电商素材,只保留项链本身,边缘干净",
"inputImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
"imgNum": 1,
"ratio": "1:1"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/aimultiposeinputImg必填refImg可选prompt可选mode可选model可选resolution可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/aimultipose" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"prompt": "同一位女性模特,改为自然站立、双手轻搭身前的半身姿势",
"mode": "2",
"model": "bananaPro",
"resolution": "2K",
"ratio": "3:4"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/productgalleryplanimageUrls必填sellingPoints可选extraRequirement可选platform可选desMarket可选desLang可选visualStyle可选planDirections可选planDirectionNames可选dhModel可选dhMode可选dhResolution可选dhNum可选dhImgRatio可选dhSizeMode可选开发者接口是 POST /api/openapi/productgalleryplan,请求头带 Authorization: Bearer dhk_。响应是 SSE,请用 curl -N 或按事件流读取。
按当前标价计费。计费项未配置时拒绝调用,不使用默认积分。策划失败、超时或未返回 result 时,已扣积分自动退回。成功只扣这一次,后面的出图再按电商套图单独计费。
事件为 thinking、result、error、done。result 的 data 是 JSON,items 里有 cateName、name、prompt、imgRatio。
不创建出图任务,也不返回 uuid。把 items 整理成下方电商套图的 tasks 后,再单独提交出图。
imageUrls 至少 1 张,最多 10 张。方向超过 50 个会直接拒绝,这种参数错误不会扣费。
curl -N -X POST "https://dhd.douhuiai.com/api/openapi/productgalleryplan" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"imageUrls": [
"https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png"
],
"sellingPoints": "1. 瓶身标识清楚,膏体可见\n2. 质地轻薄,适合日常保湿\n3. 适合作为面霜主图、质地细节图和梳妆台场景图",
"extraRequirement": "优先规划白底主图、膏体质地特写、梳妆台使用场景",
"platform": "天猫",
"desMarket": "中国",
"desLang": "中文",
"visualStyle": "干净棚拍,浅色背景",
"dhModel": "bananaPro",
"dhMode": "bananaPro",
"dhResolution": "2K",
"dhNum": 1,
"dhImgRatio": "1:1",
"dhSizeMode": "smart"
}'event: thinking
data: 正在分析面霜包装和适合的电商图类型...
event: result
data: {"items":[{"cateName":"白底主图","name":"白底主图","prompt":"面霜瓶身完整居中直立,纯白背景,底部保留柔和投影,logo和膏体颜色不变。","imgRatio":"1:1"},{"cateName":"细节材质图","name":"膏体质地","prompt":"近景展示面霜膏体的光泽和细腻质地,瓶身logo仍可辨认,背景干净,不改变包装颜色。","imgRatio":"4:5"}]}
event: done
data: okhttps://dhd.douhuiai.com/api/aiart/doBatchTaskdhAiType必填parentAiType必填sourceMode必填pathname必填createMode必填executorType必填parentToolKey必填subcatename必填dhInputImgs必填tasks必填tasks[].dhModel必填tasks[].dhMode必填tasks[].dhImgNum必填tasks[].dhImgRatio必填tasks[].dhSizeMode可选tasks[].dhResolution必填sellingPoints可选marketConfig可选globalConfig可选planDirections可选dhDesignMode可选出图地址是 POST https://dhd.douhuiai.com/api/aiart/doBatchTask。请求体是任务数组 tasks,不要传 groups 或 aiTypeId。
parentAiType、sourceMode、pathname 必须分别是 productgallery、productgallery_agent、/ai-image/productgallery,否则不会按电商套图处理。
鉴权可用已登录网站会话,或请求头 Authorization: Bearer dhk_密钥。带密钥时按 API 账户扣积分。
成功时读 uuid 或 task_uuid,再用任务轮询接口查进度。每个任务按自己的模型和张数分别扣费。
策划接口返回的 items 需要调用方补上模型和张数:name 写入 title 与 taskName,cateName 写入 directionName,prompt 原样放入 tasks[].prompt。
curl -X POST "https://dhd.douhuiai.com/api/aiart/doBatchTask" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"dhAiType": "labbatchimg",
"parentAiType": "productgallery",
"parentToolKey": "productgallery",
"createMode": "agent",
"executorType": "labbatchimg",
"sourceMode": "productgallery_agent",
"subcatename": "labbatchimg",
"pathname": "/ai-image/productgallery",
"dhDesignMode": "bananaPro",
"dhInputImgs": [
"https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png"
],
"sellingPoints": "1. 瓶身标识清楚,膏体可见\n2. 质地轻薄,适合日常保湿",
"marketConfig": {
"platform": "天猫",
"desMarket": "中国",
"desLang": "中文",
"visualStyle": "干净棚拍,浅色背景"
},
"tasks": [
{
"title": "白底主图",
"taskName": "白底主图",
"directionName": "白底主图",
"prompt": "基于这瓶面霜生成白底主图:瓶身完整居中直立,纯白背景,底部保留柔和投影,logo和膏体颜色不变。",
"dhModel": "bananaPro",
"dhMode": "bananaPro",
"dhResolution": "2K",
"dhImgNum": 1,
"dhImgRatio": "1:1",
"dhSizeMode": "smart",
"dhInputImgs": [
"https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png"
],
"scene": "productgallery"
},
{
"title": "膏体质地",
"taskName": "膏体质地",
"directionName": "细节材质图",
"prompt": "近景展示面霜膏体的光泽和细腻质地,瓶身logo仍可辨认,背景干净,不改变包装颜色。",
"dhModel": "bananaPro",
"dhMode": "bananaPro",
"dhResolution": "2K",
"dhImgNum": 1,
"dhImgRatio": "4:5",
"dhSizeMode": "smart",
"dhInputImgs": [
"https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png"
],
"scene": "productgallery"
}
],
"globalConfig": {
"dhModel": "bananaPro",
"dhMode": "bananaPro",
"dhResolution": "2K",
"dhImgNum": 1,
"dhImgRatio": "1:1",
"dhSizeMode": "smart"
}
}'{
"status": 200,
"msg": "任务已入队",
"uuid": "task_a1b2c3d4e5",
"task_uuid": "task_a1b2c3d4e5",
"data": {
"task_uuid": "task_a1b2c3d4e5",
"task_id": 123456,
"total_count": 2
}
}/api/openapi/gensceneinputImg必填prompt可选options可选refImg可选imgNum可选model可选resolution可选ratio可选sizeMode可选inputImgs可选传入 inputImgs 时按批量提交,最多 24 张。options 的键见字段说明。
curl -X POST "https://dhd.douhuiai.com/api/openapi/genscene" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png",
"prompt": "家用地板清洁场景,机器放在光洁地砖上",
"options": {
"producttype": "家用清洗机",
"producttitle": "手持清洗机",
"scenetype": "家庭清洁",
"scenestyle": "明亮现代家居",
"deslang": "中文",
"sellpoint": "轻便手持,适合地面缝隙清洁"
},
"model": "gpt2",
"imgNum": 1,
"resolution": "1K",
"ratio": "1:1",
"sizeMode": "smart"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/virtualtryoninputImg必填prompt可选options可选refImg可选imgNum可选model可选resolution可选ratio可选sizeMode可选inputImgs可选传入 inputImgs 时按批量提交,最多 24 张。options 的键见字段说明。
curl -X POST "https://dhd.douhuiai.com/api/openapi/virtualtryon" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
"refImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"prompt": "女性模特佩戴这条项链,半身棚拍,项链大小和吊坠造型不变",
"options": {
"producttype": "项链",
"producttitle": "几何吊坠项链",
"deslang": "中文"
},
"model": "bananaPro",
"imgNum": 1,
"resolution": "2K",
"ratio": "3:4",
"sizeMode": "smart"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/sellingpointinputImg必填prompt可选options可选refImg可选imgNum可选model可选resolution可选ratio可选sizeMode可选inputImgs可选传入 inputImgs 时按批量提交,最多 24 张。options 的键见字段说明。
curl -X POST "https://dhd.douhuiai.com/api/openapi/sellingpoint" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
"prompt": "面霜卖点图,突出瓶身和膏体,旁边留出售点文字区",
"options": {
"producttype": "面霜",
"producttitle": "HR面霜",
"sellpoint": "深层保湿,质地清爽",
"deslang": "中文",
"fonttype": "简约无衬线"
},
"model": "gpt2",
"imgNum": 1,
"resolution": "1K",
"ratio": "3:4",
"sizeMode": "smart"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/ecommerceinputImg必填prompt可选options可选refImg可选imgNum可选model可选resolution可选ratio可选sizeMode可选inputImgs可选传入 inputImgs 时按批量提交,最多 24 张。options 的键见字段说明。
curl -X POST "https://dhd.douhuiai.com/api/openapi/ecommerce" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
"prompt": "沙滩鞋白底主图,鞋子完整、底部有轻微真实投影",
"options": {
"producttype": "沙滩鞋",
"producttitle": "编织沙滩鞋",
"deslang": "中文"
},
"model": "gpt2",
"imgNum": 1,
"resolution": "1K",
"ratio": "1:1",
"sizeMode": "smart"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/detailenhanceinputImg必填prompt可选options可选refImg可选imgNum可选model可选resolution可选ratio可选sizeMode可选inputImgs可选传入 inputImgs 时按批量提交,最多 24 张。options 的键见字段说明。
curl -X POST "https://dhd.douhuiai.com/api/openapi/detailenhance" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
"prompt": "项链吊坠和链节的近景细节,突出金属质感",
"options": {
"producttype": "项链",
"producttitle": "几何吊坠项链",
"sellpoint": "链节细腻,吊坠轮廓清楚",
"deslang": "中文"
},
"model": "gpt2",
"imgNum": 1,
"resolution": "2K",
"ratio": "1:1",
"sizeMode": "smart"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/productedittool必填inputImg必填prompt可选maskImg可选imgNum可选model可选resolution可选ratio可选sizeMode可选curl -X POST "https://dhd.douhuiai.com/api/openapi/productedit" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"tool": "universaledit",
"inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
"prompt": "保留瓶身和logo,把背景换成纯白,瓶底保留柔和投影",
"model": "gpt2",
"imgNum": 1,
"resolution": "1K",
"ratio": "1:1",
"sizeMode": "smart"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/replacebginputImg必填refImg可选sceneMode可选refMode可选bgColor可选prompt可选model可选resolution可选ratio可选sizeMode可选固定出 1 张,没有 imgNum。
curl -X POST "https://dhd.douhuiai.com/api/openapi/replacebg" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
"sceneMode": "color",
"refMode": 1,
"bgColor": "#ffffff",
"model": "normal",
"resolution": "1K",
"ratio": "1:1",
"sizeMode": "smart"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/itemreplaceinputImg必填refImg可选maskImg可选prompt可选mode可选imgNum可选resolution可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/itemreplace" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"refImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
"prompt": "把人物胸前的饰品替换成参考图中的这条项链,人物脸和服装不变",
"mode": "smart",
"imgNum": 1,
"resolution": "1K",
"ratio": "3:4"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/modelfittinginputImg必填inputImgs必填prompt可选mode可选model可选imgNum可选resolution可选ratio可选generationMode可选curl -X POST "https://dhd.douhuiai.com/api/openapi/modelfitting" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"inputImgs": [
"https://img2.douhuiai.com/dhimg/img/202607/6a65733626019.jpg"
],
"prompt": "让这位女性模特穿上这套赛车服,服装版型、徽章和配色保持不变,自然站立",
"mode": "smart",
"model": "bananaPro",
"imgNum": 1,
"resolution": "2K",
"ratio": "3:4",
"generationMode": "single"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/replacemodelinputImg必填refImg可选prompt可选options可选model可选resolution可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/replacemodel" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a65733626019.jpg",
"refImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"prompt": "保留赛车服,把穿着者换成参考图中的女性模特",
"model": "gpt2",
"resolution": "1K",
"ratio": "3:4"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/addmodelinputImg必填refImg可选maskImg可选prompt可选mode可选imgNum可选resolution可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/addmodel" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png",
"refImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"prompt": "在清洗机旁边加入参考图中的女性,她单手扶住机器介绍产品,机器外形不变",
"mode": "smart",
"imgNum": 1,
"resolution": "1K",
"ratio": "3:4"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/imgtranslateinputImg必填inputImgs可选lang必填mode可选model必填resolution可选ratio可选sizeMode可选传入 inputImgs 时按批量翻译。
curl -X POST "https://dhd.douhuiai.com/api/openapi/imgtranslate" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
"lang": "英语",
"model": "gpt2",
"resolution": "1K",
"ratio": "1:1",
"sizeMode": "smart"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/stylefusioninputImgs必填prompt可选model可选imgNum可选resolution可选ratio可选sizeMode可选curl -X POST "https://dhd.douhuiai.com/api/openapi/stylefusion" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImgs": [
"https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
"https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png"
],
"prompt": "保留沙滩鞋的鞋型,把鞋面改成第二张帆布包设计图的印花和配色",
"model": "bananaPro",
"imgNum": 1,
"resolution": "1K",
"ratio": "1:1",
"sizeMode": "smart"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/textimageprompt必填inputImg可选imgNum可选ratio可选resolution可选curl -X POST "https://dhd.douhuiai.com/api/openapi/textimage" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "根据这张帆布包设计图,生成一款同系列托特包,正面居中,白底,保留原有图形语言",
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png",
"imgNum": 1,
"ratio": "1:1",
"resolution": "1K"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/goodsdesignprompt可选inputImg必填refImg可选imgNum可选mode可选resolution可选ratio可选model可选subType可选curl -X POST "https://dhd.douhuiai.com/api/openapi/goodsdesign" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "在这张帆布包设计图的基础上,做一款深蓝配色的新配色,包型和图案结构不变",
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png",
"imgNum": 2,
"ratio": "1:1",
"resolution": "1K"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/colorcadinputImg必填prompt可选mode可选refImg可选imgNum可选resolution可选ratio可选model可选curl -X POST "https://dhd.douhuiai.com/api/openapi/colorcad" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
"prompt": "按这张平面图纸填充墙体、家具和地面材质,保留原始户型墙线,输出彩色平面图",
"imgNum": 1,
"resolution": "2K",
"ratio": "4:3"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/idmodelinputImg必填prompt可选mode可选refImg可选imgNum可选resolution可选ratio可选model可选curl -X POST "https://dhd.douhuiai.com/api/openapi/idmodel" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
"prompt": "按平面图的房间关系生成日光室内效果图,现代简约,保留门窗和墙体位置",
"imgNum": 1,
"resolution": "2K",
"ratio": "16:9"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/roughcastinputImg必填prompt可选mode可选refImg可选imgNum可选resolution可选ratio可选model可选curl -X POST "https://dhd.douhuiai.com/api/openapi/roughcast" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
"prompt": "把这张户型转成已精装的客厅视角,浅木地板,白色墙面,保留房间比例",
"imgNum": 1,
"resolution": "2K",
"ratio": "16:9"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/conceptprompt必填inputImg可选imgNum可选ratio可选resolution可选model可选curl -X POST "https://dhd.douhuiai.com/api/openapi/concept" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "根据这张平面图做一张建筑概念效果图,白天,玻璃和浅色石材,低层建筑",
"inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
"imgNum": 1,
"ratio": "16:9",
"resolution": "2K"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/postprocessinputImg必填prompt可选tool可选imgNum可选resolution可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/postprocess" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
"tool": "photoclear",
"prompt": "提高线条和色块清晰度,不改户型",
"imgNum": 1,
"resolution": "2K"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/renderenhanceinputImg必填tool必填resolution可选curl -X POST "https://dhd.douhuiai.com/api/openapi/renderenhance" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
"tool": "detail",
"resolution": "2K"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/furnishreplaceinputImg必填refImg可选maskImg可选prompt可选mode可选imgNum可选resolution可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/furnishreplace" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
"prompt": "保留户型墙线,把客厅家具换成浅色布艺沙发和原木茶几",
"mode": "smart",
"imgNum": 1,
"resolution": "2K",
"ratio": "4:3"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/idtransforminputImg必填prompt可选mode可选refImg可选imgNum可选resolution可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/idtransform" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
"prompt": "同一户型,改成北欧风格彩色平面,墙线位置不变",
"imgNum": 1,
"resolution": "2K",
"ratio": "4:3"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/idlineinputImg必填prompt可选mode可选refImg可选imgNum可选resolution可选ratio可选model可选curl -X POST "https://dhd.douhuiai.com/api/openapi/idline" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
"prompt": "依据这张线稿平面,渲染成带家具图例的彩色平面图,不移动墙体",
"imgNum": 1,
"resolution": "2K",
"ratio": "4:3"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/addcharacterinputImg必填refImg可选maskImg可选prompt可选mode可选imgNum可选resolution可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/addcharacter" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
"refImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"prompt": "在客厅活动区加入参考图中的女性,比例符合室内空间,不挡住主要家具",
"mode": "smart",
"imgNum": 1,
"resolution": "2K",
"ratio": "16:9"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/idphotoinputImg必填prompt可选bgColor可选resolution可选curl -X POST "https://dhd.douhuiai.com/api/openapi/idphoto" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"prompt": "标准证件照,正面,露出双耳,白色背景",
"bgColor": "#ffffff",
"resolution": "1K"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/fixphotoinputImg必填blurLevel可选curl -X POST "https://dhd.douhuiai.com/api/openapi/fixphoto" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202603/69b52ea4e1303.jpg",
"blurLevel": 2
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/swapfaceinputImg必填faceImg必填curl -X POST "https://dhd.douhuiai.com/api/openapi/swapface" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a58a216b92d6.png",
"faceImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/photoclearinputImg必填resolution可选curl -X POST "https://dhd.douhuiai.com/api/openapi/photoclear" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"resolution": "2K"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/recolorinputImg必填curl -X POST "https://dhd.douhuiai.com/api/openapi/recolor" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202603/69b52ea4e1303.jpg"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/aiportraitinputImg必填prompt必填ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/aiportrait" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"prompt": "同一位女性的棚拍形象照,浅灰背景,自然妆容,半身正面",
"ratio": "3:4"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/changehairinputImg必填prompt可选refImg可选maskImg可选imgNum可选curl -X POST "https://dhd.douhuiai.com/api/openapi/changehair" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"prompt": "保持五官和服装,把发型改成低马尾,发色仍为深色",
"imgNum": 1
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/people2cartooninputImg必填prompt可选imgNum可选ratio可选curl -X POST "https://dhd.douhuiai.com/api/openapi/people2cartoon" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a58a216b92d6.png",
"prompt": "把这位女赛车手转成干净的日系漫画半身像,保留头盔和赛车服配色",
"imgNum": 1,
"ratio": "3:4"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/img2modelmode可选inputImg可选frontImg可选backImg可选leftImg可选rightImg可选faceCount可选按网站图转3D的豆点折算积分,与面数、单图或多图无关。
图片需可公网访问,单张不超过 10MB,宽高都不小于 128。
curl -X POST "https://dhd.douhuiai.com/api/openapi/img2model" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"mode": "single",
"inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
"faceCount": 1500000
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 180
}/api/openapi/videoaioprompt必填model可选version可选creationMode可选inputImg可选endImg可选inputImgs可选videos可选audios可选frames可选resolution可选duration可选ratio可选audio可选creationMode=multiFrames 时传 frames。任务异步返回 uuid,成片用任务查询或回调获取。
提交时会同时带上 dhAioSource=videoaio。
视频创作模式、时长、比例和分辨率会按模型补默认值。单张参考图传 inputImg 即可。
curl -X POST "https://dhd.douhuiai.com/api/openapi/videoaio" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "女赛车手看向镜头,头发被风轻轻吹起,背景是虚化的赛道灯光,镜头缓慢推进",
"model": "seedance2",
"version": "seedance2_0",
"creationMode": "free",
"inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a58a216b92d6.png",
"resolution": "720p",
"duration": 4,
"ratio": "9:16",
"audio": 1
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/videoeditortool必填sourceVideo必填inputVideo可选prompt可选mode可选params可选output可选referenceImages可选edit、replace、erase、style、motion、background 必须传 prompt。upscale 可不传 mode。mode 只支持 seedance2_0、seedance2_0_fast、seedance2_0_mini、happyhorse。费用按实际输入视频时长计算,不是固定秒数。
curl -X POST "https://dhd.douhuiai.com/api/openapi/videoeditor" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"tool": "edit",
"sourceVideo": "https://img2.douhuiai.com/dhimg/video/20260721/6a5ec8522c8bc.mp4",
"prompt": "保持原视频主体,把画面调得更清晰,运动更顺",
"mode": "seedance2_0",
"output": {
"resolution": "720p",
"audio": 1
}
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/aipresenterinputImg必填prompt必填voicePath必填duration必填resolution可选mode可选duration 必填,只能是 5、10、15、20、30 秒。
示例 voicePath 是音色库「甜美桃子」的公开试听 mp3。口播以这段音频为准,duration 决定成片时长。
curl -X POST "https://dhd.douhuiai.com/api/openapi/aipresenter" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
"prompt": "这款面霜质地轻薄,涂开后很快吸收,适合每天保湿。",
"voicePath": "https://img2.douhuiai.com/dhimg/audio/exps/audio/91bd95685132270530acc637159f24cc.mp3",
"resolution": "1080p",
"mode": "presenter",
"duration": 5
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}/api/openapi/voices无请求体。需要 Authorization: Bearer dhk_。不扣积分。
data 是音色列表。把 id 填到文生音频的 voiceId。audio 是该音色的公开试听地址。
下面的返回示例只摘了两条。实际会返回当前全部可用音色,按 id 升序。
curl -X POST "https://dhd.douhuiai.com/api/openapi/voices" \ -H "Authorization: Bearer dhk_你的密钥"
{
"status": 200,
"msg": "ok",
"data": [
{
"id": 321,
"name": "甜美桃子",
"gender": "女",
"age": "青年",
"emotion": "通用",
"cate1": "通用场景",
"cate2": "",
"cate3": "",
"audio": "https://img2.douhuiai.com/dhimg/audio/exps/audio/91bd95685132270530acc637159f24cc.mp3"
},
{
"id": 323,
"name": "Tina老师",
"gender": "女",
"age": "青年",
"emotion": "通用",
"cate1": "教学场景",
"cate2": "",
"cate3": "通用场景",
"audio": "https://img2.douhuiai.com/dhimg/audio/exps/audio/cd02acdeb71cc0aa87bcb37414de8c82.mp3"
}
]
}/api/openapi/voicecloneprompt必填voiceId必填emotion可选lang可选按文本长度从 API 积分扣费。返回的是音频任务 uuid。
先调用音色库拿到 id,再填到 voiceId。321 是「甜美桃子」。不要传「编号|works」。
curl -X POST "https://dhd.douhuiai.com/api/openapi/voiceclone" \
-H "Authorization: Bearer dhk_你的密钥" \
-H "Content-Type: application/json" \
-d '{
"prompt": "这款面霜质地轻薄,涂开后很快吸收,适合每天保湿。",
"voiceId": "321",
"lang": "中文"
}'{
"status": 200,
"msg": "",
"uuid": "a1b2c3d4e5",
"wait_time": 40
}