APIMODELSAPIMODELS
Docs/Z-Image Spicy API

Z-Image Spicy API

Z-Image Spicy text-to-image in two tiers with one request shape: z-image-spicy renders 256–1536 px per side at $0.015 per image; z-image-spicy-pro renders 256–2560 px per side at $0.03. You set the output size: width / height, an OpenAI-style size, or just an aspect_ratio with the long side pushed to the tier limit. Seed for repeatable output, prompt_extend can be toggled. One image per request, 12–30 s.

Autenticação

Authorization: Bearer YOUR_API_KEY

Model & pricing

ModelmodelPriceNotas
Z-Image Spicyz-image-spicy$0.015 per image256–1536 px per side, flat price for any size; one image per request
Z-Image Spicy Proz-image-spicy-pro$0.03 per image256–2560 px per side, flat price for any size; prompt_extend off by default

Pricing examples: z-image-spicy 10 images = $0.15, 100 images = $1.50; z-image-spicy-pro 10 images = $0.30, 100 images = $3.00. Independent of size, seed or prompt_extend. Failed requests are not charged.

Code examples

# ─── 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/..."] } }

Parâmetros da requisição

FieldRequiredTypeDescription
modelYesstringz-image-spicy / z-image-spicy-pro
promptYesstringText description of the image
widthNonumberWidth in pixels, 256–1536 (Pro 256–2560); pass together with height
heightNonumberHeight in pixels, 256–1536 (Pro 256–2560); pass together with width
sizeNostringOpenAI-style "WIDTHxHEIGHT", e.g. 1536x864 / 2560x1440; without callback_url the image is returned in the same response
aspect_ratioNostring1:1 16:9 9:16 4:3 3:4 3:2 2:3 5:4 4:5 21:9 9:21, long side fixed at 1536 (Pro 2560); with no size information the default is 1024x1536 (Pro 1024x1024)
seedNonumberRandom seed (0 to 2147483647) for reproducible output; random when omitted
prompt_extendNobooleanExpand the prompt before rendering: default true on z-image-spicy, false on Pro; false draws your prompt verbatim
callback_urlNostringWebhook URL called when the task completes

Notas

  • Text-to-image only: image / image_urls / mask are rejected with a 400, never silently dropped
  • Size precedence: width+height > size > aspect_ratio; any side beyond the tier limit (1536 / Pro 2560) is a 400, never a silent downscale; there are no resolution tiers, every size costs the same
  • One image per request (n greater than 1 is a 400); for a batch send several requests in parallel, each billed and queried on its own
  • Async: create a task for a taskId, then poll GET ?task_id=; for a one-call response pass size "WIDTHxHEIGHT" without callback_url
  • Result files are deleted after 30 days; download or re-host them in time
  • Charged only on success

Try it in the Playground

Perguntas frequentes

How much do Z-Image Spicy and Spicy Pro cost?

Flat per-image prices: $0.015 on z-image-spicy and $0.03 on z-image-spicy-pro, whatever the size, seed or prompt_extend setting. Each request produces one image and is charged only on success.

What output sizes do Z-Image Spicy and Spicy Pro support?

Any width and height from 256 to 1536 pixels per side on z-image-spicy, and 256 to 2560 on z-image-spicy-pro. Pass width and height, an OpenAI-style size such as 1536x864 or 2560x1440, or an aspect_ratio like 16:9 (the long side is then set to the tier limit). There are no resolution tiers; sizes beyond the limit are rejected instead of silently downscaled.

Does Z-Image Spicy accept reference images?

No. It is text-to-image only; image, image_urls and mask are rejected with a 400. For image-to-image use a model such as flux-2-klein-4b or gpt-image-2.