Skip to Content

Z-Image

Overview

Z-Image is a fast and efficient text-to-image model that offers high-quality image generation with support for multiple aspect ratios. It provides quick turnaround times at an affordable cost.

Test API KEY: key_00000000000000000000000000000000

Endpoints

1. Create Task

Request

POST https://api.pixwith.ai/api/task/create

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Api-Key{API_KEY}Yes

Request Parameters

ParameterTypeRequiredDescription
promptstringYesThe input prompt (e.g., “a beautiful sunset over the ocean”)
model_idstringYes0-31
optionsobjectYesConfiguration options for the task
options.prompt_optimizationbooleanYesIf true, all prompt words will be automatically translated into English.
options.num_outputsintYesNumber of images to generate. Valid values: 1, 2, 3, or 4
options.aspect_ratiostringYesAspect ratio of the output. Valid values: '1:1' (Default), '4:3', '3:4', '2:3', '3:2', '16:9', '9:16', '21:9'.

Example Request

{ "prompt": "a beautiful sunset over the ocean", "model_id": "0-31", "options": { "prompt_optimization": true, "num_outputs": 1, "aspect_ratio": "16:9" } }

Response Parameters

ParameterTypeDescription
codeint1=success, 0=error
messagestringSuccess and failure messages
dataobject
data.task_idstring
data.estimated_timeintEstimated time in seconds

Response

{ "code": 1, "message": "success", "data": { "task_id": "d425ab4dc256f0ebaa84862b9cea8a3d", "estimated_time": 25 } }
Last updated on