Z-Image Spicy 文生图,两档同一套请求:z-image-spicy 单边 256–1536px、$0.015/张;z-image-spicy-pro 单边 256–2560px、$0.03/张。输出尺寸由你定:width / height 或 OpenAI 风格的 size,或只传 aspect_ratio 让长边顶到该档上限。seed 可复现,prompt_extend 可开关。一单一图,12–30 秒。
Authorization: Bearer YOUR_API_KEY| 模型 | model | 价格 | 说明 |
|---|---|---|---|
| Z-Image Spicy | z-image-spicy | $0.015/张 | 单边 256–1536px,一口价,任意尺寸同价;一次请求一张图 |
| Z-Image Spicy Pro | z-image-spicy-pro | $0.03/张 | 单边 256–2560px,一口价,任意尺寸同价;prompt_extend 默认关 |
计费示例:z-image-spicy 10 张 = $0.15、100 张 = $1.50;z-image-spicy-pro 10 张 = $0.30、100 张 = $3.00。与尺寸、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" } }
# ─── Pro tier: exact pixel size up to 2560 per side ($0.03) ──
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-pro",
"prompt": "a red fox on a mossy log, golden hour, shallow depth of field",
"width": 2560,
"height": 1440,
"seed": 42
}'
# (on z-image-spicy the same body works with sides up to 1536)
# ─── 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 / z-image-spicy-pro |
| prompt | 是 | string | 图片文字描述 |
| width | 否 | number | 像素宽,256–1536(Pro 256–2560),与 height 成对传 |
| height | 否 | number | 像素高,256–1536(Pro 256–2560),与 width 成对传 |
| size | 否 | string | OpenAI 风格 "宽x高",如 1536x864 / 2560x1440;不带 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(Pro 2560);不传尺寸信息时默认 1024x1536(Pro 1024x1024) |
| seed | 否 | number | 随机种子(0 到 2147483647),固定可复现;不传则随机 |
| prompt_extend | 否 | boolean | 是否先扩写提示词再出图:z-image-spicy 默认 true,Pro 默认 false;false 严格按原文 |
| callback_url | 否 | string | 任务完成后的回调 URL |
试一试:Playground
按张一口价:z-image-spicy $0.015/张,z-image-spicy-pro $0.03/张,与尺寸、seed、prompt_extend 无关。一次请求出一张,仅成功扣费。
z-image-spicy 单边 256–1536px、z-image-spicy-pro 单边 256–2560px 的任意宽高。可以传 width 和 height、OpenAI 风格的 size(如 1536x864、2560x1440),或只传 aspect_ratio(如 16:9,长边顶到该档上限)。没有分辨率档位,超过上限会直接报错,不会静默降尺寸。
不能。它是纯文生图,image / image_urls / mask 会直接返回 400。要图生图请用 flux-2-klein-4b 或 gpt-image-2 等模型。