Z-Image Spicy 文生图——输出尺寸由你定:width / height 或 OpenAI 风格的 size,单边 256–1536px;或只传 aspect_ratio,长边固定 1536。seed 可复现,prompt_extend 可关。一单一图,约 15 秒,一口价 $0.015/张。
Authorization: Bearer YOUR_API_KEY| 模型 | model | 价格 | 说明 |
|---|---|---|---|
| Z-Image Spicy | z-image-spicy | $0.015/张 | 一口价,任意尺寸同价;一次请求一张图 |
计费示例:10 张 = $0.15,100 张 = $1.50,与尺寸、seed、prompt_extend 无关。失败不扣费。
# ─── Text-to-image by aspect ratio (long side = 1536) ─────
curl -X POST https://api.apimodels.app/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "z-image-spicy",
"prompt": "a red fox on a mossy log, golden hour, shallow depth of field",
"aspect_ratio": "16:9",
"seed": 42
}'
# Response (async — a task is created):
# { "code": 200, "data": { "taskId": "clxxx", "state": "pending" } }
# ─── Exact pixel size (256–1536 per side), prompt used verbatim ──
curl -X POST https://api.apimodels.app/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "z-image-spicy",
"prompt": "minimal poster, one bold word: SUMMER, warm gradient",
"width": 1152,
"height": 1536,
"prompt_extend": false
}'
# ─── Poll for the result ──────────────────────────────────
curl "https://api.apimodels.app/v1/images/generations?task_id=TASK_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
# { "code": 200, "data": { "state": "completed", "resultUrls": ["https://r2.apimodels.app/..."] } }| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| model | 是 | string | z-image-spicy |
| prompt | 是 | string | 图片文字描述 |
| width | 否 | number | 像素宽,256–1536,与 height 成对传 |
| height | 否 | number | 像素高,256–1536,与 width 成对传 |
| size | 否 | string | OpenAI 风格 "宽x高",如 1536x864;不带 callback_url 时同一响应直接返回图片 |
| aspect_ratio | 否 | string | 1:1 16:9 9:16 4:3 3:4 3:2 2:3 5:4 4:5 21:9 9:21,长边固定 1536;不传尺寸信息时默认 1024x1536 |
| seed | 否 | number | 随机种子(0 到 2147483647),固定可复现;不传则随机 |
| prompt_extend | 否 | boolean | 是否先扩写提示词再出图,默认 true;传 false 严格按原文 |
| callback_url | 否 | string | 任务完成后的回调 URL |
试一试:Playground
一口价 $0.015/张,与尺寸、seed、prompt_extend 无关。一次请求出一张,仅成功扣费。
单边 256–1536px 的任意宽高。可以传 width 和 height、OpenAI 风格的 size(如 1536x864),或只传 aspect_ratio(如 16:9,长边固定 1536)。没有 2K / 4K 档,超过 1536 会直接报错,不会静默降尺寸。
不能。它是纯文生图,image / image_urls / mask 会直接返回 400。要图生图请用 flux-2-klein-4b 或 gpt-image-2 等模型。