Image generation API
Generate an image from a text prompt with the Pendra API. OpenAI-compatible, with every field and each model's defaults.
POST
/api/v1/images/generations
New to image generation? Start with the
Image generation guide. This page
is the field-by-field reference.
Body
application/json
model
string
Required
An image model, such as
z-image-turbo. See each model's defaults below.
prompt
string
Required
What the image should show.
size
string
default: the model's own size
Width and height as
WxH, such as 1024x1024.
Leave it out for the size the model was made for, which looks best.
n
integer
default: 1
How many images to make, from 1 to 4.
negative_prompt
string
What the image should avoid.
num_inference_steps
integer
default: the model's own
From 1 to 50. More steps are slower but can be sharper.
seed
integer
Set it to get the same image again for the same request.
response_format
string
default: b64_json
Always
b64_json.
Response
data has one entry per image, each a base64-encoded PNG in
b64_json. Decode it to save the file.
Each model's defaults
| Model | Size | Steps |
|---|---|---|
flux.1-schnell | 1024x1024 | 4 |
flux.2-klein | 512x512 | 4 |
krea-2-turbo | 768x768 | 8 |
qwen-image-2512 | 1024x1024 | 20 |
sdxl-turbo | 512x512 | 4 |
stable-diffusion-3.5-large-turbo | 1024x1024 | 4 |
z-image-turbo | 1024x1024 | 8 |
Good to know
- Most images take 5 to 30 seconds. A request can run for up to 30 minutes on a busy worker, and the connection stays open while it works.
- Image requests show under Images in the console's usage view.