Skip to main content
POST
Generate

Authorizations

X-API-Key
string
header
required

Body

application/json

Request body for the generate endpoint.

Provide a text prompt describing the image you want to create. Reference profiles inline using [[profile_id]] syntax to specify which people should appear in the generated image.

async
boolean
default:false

Submit asynchronously. Returns 202 with a job_id to poll at GET /v1/jobs/{job_id} instead of holding the connection until the image is ready.

callback_url
string | null

Optional https URL we POST the signed result to on completion. Best-effort (polling remains authoritative). Requires async=true.

client_request_id
string | null

Idempotency key. A retried submit with the same value returns the original job instead of creating (and charging for) a new one.

response_mode
enum<string>
default:bytes

Response delivery mode. 'bytes': return base64-encoded image data (default). 'urls': return signed download URLs (24-hour expiry) instead of image bytes.

Available options:
bytes,
urls
prompt
string
default:""

Text prompt describing the desired edit.

num_output_images
integer
default:1

Number of output images to generate (1-4).

Required range: 1 <= x <= 4
aspect_ratio
enum<string>
default:auto

Output aspect ratio (auto, 1:1, 3:4, 4:3, 9:16, 16:9).

Available options:
auto,
1:1,
3:4,
4:3,
9:16,
16:9
resolution
enum<string>
default:1K

Output resolution (1K, 2K, 4K). Per-model support varies; see /models.

Available options:
1K,
2K,
4K
quality
enum<string> | null

Quality tier (auto, low, medium, high). Only supported by gpt-image-2; passing this field for other models returns 400. Omit (or pass 'auto') to let the provider pick — for gpt-image-2 this resolves to OpenAI's auto tier. Lower tiers reduce output tokens and therefore settled cost.

Available options:
auto,
low,
medium,
high
base_model
enum<string>
default:nb2

Base model identifier. Omit to use the default base model. Unknown ids are rejected with 400; base models that do not support this endpoint's capability are also rejected with 400.

Available options:
flux-2,
gpt-image-2,
nb2,
qwen-image-2,
reve
output_format
enum<string>
default:png

Output image format (png, jpg). Default: png (will change to jpg on 2026-05-08).

Available options:
png,
jpg

Response

Successful Response

Response returned by the edit, generate, and enhance endpoints.

known_subjects
KnownGeneratedSubjectCounts · object
required

Dictionary mapping a known subject's profile_id to the number of times they were generated. If multiple variations are generated, this will be the aggregated count across all variations.

images
string[]

Output image(s) as raw base64-encoded strings. Format matches the requested output_format. Populated when response_mode='bytes', empty otherwise.

download_urls
string[]

Signed download URLs for each output image (24-hour expiry). Populated when response_mode='urls', empty otherwise.