Skip to main content
POST
/
v1
/
ai
/
text-to-image
/
z-image
curl --request POST \
  --url https://api.freepik.com/v1/ai/text-to-image/z-image \
  --header 'Content-Type: application/json' \
  --header 'x-freepik-api-key: <api-key>' \
  --data '
{
  "prompt": "A suited raccoon smoking a cigar"
}
'
{
"data": {
"generated": [],
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "IN_PROGRESS"
}
}

Authorizations

x-freepik-api-key
string
header
required

Your Freepik API key. Required for authentication. Learn how to obtain an API key

Body

application/json
prompt
string
required

Text description of the image you want to generate.

Tips:

  • Be specific about visual details, composition, and style
  • Z-Image excels at fast, high-quality image generation
  • Works well with detailed scene descriptions

Examples:

  • Simple: "A suited raccoon smoking a cigar"
  • Detailed: "A cyberpunk city street at night, neon signs reflecting on wet pavement, flying cars in the distance"
Maximum string length: 4096
Example:

"A suited raccoon smoking a cigar"

webhook_url
string<uri>

Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.

Example:

"https://www.example.com/webhook"

image_size
enum<string>
default:square_hd

The aspect ratio and size of the generated image. If not specified, defaults to square_hd (1024x1024).

Available sizes:

  • square: 512x512 pixels
  • square_hd: 1024x1024 pixels (default)
  • portrait_3_4: 768x1024 pixels
  • portrait_9_16: 576x1024 pixels
  • landscape_4_3: 1024x768 pixels
  • landscape_16_9: 1024x576 pixels
Available options:
square,
square_hd,
portrait_3_4,
portrait_9_16,
landscape_4_3,
landscape_16_9
Example:

"square_hd"

num_inference_steps
integer
default:8

The number of inference steps to perform. Higher values may produce more detailed images but take longer. For Z-Image turbo, 8 steps is recommended for optimal speed/quality balance.

Required range: 1 <= x <= 50
Example:

8

seed
integer

Random seed for reproducibility. Using the same seed with identical parameters produces the same image. Useful for iterating on a design or creating variations.

Required range: 0 <= x <= 4294967295
Example:

42

output_format
enum<string>
default:png

The format of the generated image.

  • png: Lossless format, best for images with text or sharp edges
  • jpeg: Compressed format, smaller file size
Available options:
jpeg,
png
Example:

"png"

enable_safety_checker
boolean
default:true

Whether to enable the content safety checker. When enabled, the model filters potentially unsafe content.

Response

OK - The request has succeeded and the Z-Image process has started.

data
object
required
Example:
{
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "CREATED",
"generated": [
"https://openapi-generator.tech",
"https://openapi-generator.tech"
]
}