图像生成
POST /v1/images/generations 创建图像任务并立即返回。轮询共享任务端点以获取结果。
shell
curl -sS -X POST https://api.dreamutopia.net/v1/images/generations \
-H "Authorization: Bearer $DREAMUTOPIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "pro",
"prompt": "a red fox in fresh snow, cinematic lighting",
"resolution": "2k",
"aspect_ratio": "16:9"
}'response 202
{ "id": "3f2b…", "type": "image", "status": "queued", "created_at": "2026-10-24T12:00:00Z" }字段
| 字段 | 价值观 |
|---|---|
| model | lite, pro |
| prompt | 必填,不能为空,最多 8,000 个字符 |
| resolution | 2k、4k;lite 仅接受 2k |
| aspect_ratio | 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, adaptive |
| reference_images | 上传 ID 或 DreamUtopia URL;lite 为 0–3,pro 为 0–14 |
model
- 价值观
lite,pro
prompt
- 价值观
- 必填,不能为空,最多 8,000 个字符
resolution
- 价值观
2k、4k;lite仅接受2k
aspect_ratio
- 价值观
1:1,4:3,3:4,16:9,9:16,3:2,2:3,adaptive
reference_images
- 价值观
- 上传 ID 或 DreamUtopia URL;
lite为 0–3,pro为 0–14
adaptive 至少需要一张参考图像。文生图请省略 reference_images。resolution 默认为 2k,aspect_ratio 默认为 1:1,因此 model + prompt 即为有效请求。
混合参考
单张参考图是图生图;两张及以上是多参考混合。请先上传每个文件,并按顺序传入 id。
shell
-d '{
"model": "pro",
"prompt": "combine the two products on one studio table",
"resolution": "2k",
"aspect_ratio": "adaptive",
"reference_images": ["<upload_id>", "<upload_id>"]
}'成本
图像额度按档位固定收取。实时值位于 GET /v1/models 中的 image[].credits 下。额度在创建任务时扣除,若任务失败则退还。