Z-Image Spicy Pro API

by Alibaba

Z-Image at exact custom sizes up to 2560 px

alibaba/z-image-spicy-pro/text-to-image
  • Create Image

About Z-Image Spicy Pro

Z-Image at exact custom sizes up to 2560 px.

Call it with the model name alibaba/z-image-spicy-pro/text-to-image on POST /jobs/createTask, from $0.019.

Request parameters

ParameterRequiredDescription
seedNoUse the same seed and settings for more controlled comparisons. ≥ 0 · ≤ 2147483647
widthNoOutput width in pixels for a custom size. Available limits depend on the model. ≥ 256 · ≤ 2560 · Default: 1024
heightNoOutput height in pixels for a custom size. Available limits depend on the model. ≥ 256 · ≤ 2560 · Default: 1024
promptYesDescribe what you want to make.
enable_prompt_expansionNoLets the model add detail to a short prompt. Default: false

Pricing

Prices are in USD and charged to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.

OptionUSD per image
Standard$0.019

Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.

API quick start

Call the Z-Image Spicy Pro API in three steps

  1. Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls are billed in USD from your PopNow balance.
  2. Send the request. POST /jobs/createTask with model alibaba/z-image-spicy-pro/text-to-image and an input object that follows the parameter table. The response returns a task ID straight away.
  3. Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "alibaba/z-image-spicy-pro/text-to-image",
  "input": {
    "prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.

Z-Image Spicy Pro API questions

How much does the Z-Image Spicy Pro API cost?

Z-Image Spicy Pro costs $0.019 per image. API usage is charged in USD to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.

What is the model name for Z-Image Spicy Pro in the API?

Put alibaba/z-image-spicy-pro/text-to-image for Create Image in the model field of POST /jobs/createTask.

More about Z-Image Spicy Pro