Skip to main content
POST
  1. After submission, a task_id will be returned. If you provided a callback_url, when the task status becomes finished or failed, a POST request will be sent to the callback_url.
  2. Regardless of whether callback_url is provided, you can retrieve the response result through the unified Query Task Status endpoint.

Z-Image Generation

Generate high-quality images using the Z-Image model. Supports both text-to-image and image editing with a unified request shape. z-image uses a unified request format:
  • If input.image_urls is omitted, the request is handled as text-to-image
  • If input.image_urls is provided, the request is handled as image editing automatically

Available Model

  • z-image - Unified text-to-image and image editing model

Supported Parameters

  • prompt - Required prompt, max 1000 characters
  • size - Required for text-to-image, optional for image editing. Supported values: 1:1, 4:3, 3:4, 16:9, 9:16
  • image_urls - Optional reference image array for editing, must contain exactly 1 image URL
  • enable_safety_checker - Optional boolean safety checker switch, defaults to true

Notes

  • input.image_urls[0] is used as the edit reference image
  • When image_urls is present, size can be omitted

How to Call

Use the unified submit endpoint: POST /api/generate/submit Text-to-image example:
Image editing example:

Authorizations

Authorization
string
header
required

All API endpoints require Bearer Token authentication

Get your API Key:

Visit the API Key Management Page to get your API Key

Add it to the request header:

Body

application/json
model
enum<string>
required

Z-Image model identifier

Available options:
z-image
input
object
required

Input parameters for generation. size is required for text-to-image. When image_urls is present, the request is routed to image editing automatically and size becomes optional.

callback_url
string<uri>

Webhook callback URL for result notifications

Example:

"https://your-domain.com/callback"

Response

200 - application/json

Task submitted successfully

code
integer
required

HTTP status code

Example:

200

data
object
required