图片
一次请求结束就返回图片。没有任务号,不要轮询。size 的像素决定 1K / 2K / 4K。
https://huantu.xyz/api/v1Bearer ic_live_...成功
{ "created": 1760000000, "data": [ { "b64_json": "..." } ]}生成图片
POST
/images/generations成功读 data[0].b64_json 或 data[0].url。失败时状态码大于等于 400,不要再从 data 里取图。
- model
- 模型广场里的 ID
- prompt
- 画面描述
- size
- 如 1024x1024
- n
- 张数,省略按 1
curl
curl https://huantu.xyz/api/v1/images/generations \ -H "Authorization: Bearer ic_live_..." \ -H "Content-Type: application/json" \ -H "Idempotency-Key: image-001" \ -d '{ "model": "模型广场里的 ID", "prompt": "白色背景的运动鞋主图", "size": "1024x1024", "n": 1, "response_format": "b64_json" }'编辑图片
POST
/images/edits参考图用同名 image 重复上传。返回体和生成一样。
curl
curl https://huantu.xyz/api/v1/images/edits \ -H "Authorization: Bearer ic_live_..." \ -H "Idempotency-Key: image-edit-001" \ -F "model=模型广场里的 ID" \ -F "prompt=保留鞋子,换成夜晚街道" \ -F "[email protected]" \ -F "size=1024x1024" \ -F "response_format=b64_json"超时恢复
GET
/generation-tasks/recovery超时不要换 Idempotency-Key。成功读 data.status。
curl
curl https://huantu.xyz/api/v1/generation-tasks/recovery \ -H "Authorization: Bearer ic_live_..." \ -H "Idempotency-Key: image-001"