Generate images
Submit an image-generation job — prompt plus optional trained models — and get a job id back.
202 Accepted
with a job id; poll GET /images/generations/{id}
for the result. Combine your organization’s trained models by passing their ids —
style_id, object_ids, person_ids, setting_ids, and color_palette_id.
Example: compose multiple trained models
Pass astyle model, one or more person and setting models, and a color
palette together in one request. Every id must reference a completed model in
your organization.
object_ids, person_ids, and setting_ids are arrays; style_id and
color_palette_id are single ids. num_outputs (1–4) defaults to 1 and each
output is billed. Omit engine to use the default nano_banana_pro.Authorizations
Organization API key as a bearer token: Authorization: Bearer samsa_sk_....
Headers
Body
POST /images/generations body (ADR §8, §10).
Trained-model refs (style_id, object_ids, person_ids, setting_ids,
color_palette_id) combine on the Gemini path; setting_ids maps to the
internal scene_ids (ADR §8.2). engine is a public-safe subset of the
image engines (ADR §8.3). Note num_outputs defaults to 1 for API
ergonomics — the internal app default is 4.
Text prompt. Runs the same validation as the app (rejects empty / malformed / policy-violating prompts with a 422).
1"A minimalist product shot of a ceramic mug on linen, soft daylight"
A style model in your organization (must be completed).
object models in your organization to compose in.
person models in your organization to compose in.
setting models in your organization (maps to internal scenes).
A color palette in your organization.
Generation engine — one of nano_banana_pro (default) or nano_banana_2. Omit to use the default. Unknown engines return 422.
"nano_banana_pro"
Number of images to generate (1-4). Defaults to 1 (the app default is 4); each output is billed.
1 <= x <= 41
Aspect ratio for the generated image(s).
"1:1"
Output resolution — 1K, 2K, or 4K. Credits scale 1K:1x, 2K:2x, 4K:4x per output.
"1K"
Encoding of the returned images. v1 supports png only.
png "png"
Optional https webhook notified once on terminal status (signed per the webhook signature scheme; see the webhooks docs).
"https://example.com/webhooks/samsa"
Response
Successful Response
202 body for POST /images/generations (ADR §7.1).
The image job id — poll GET /images/generations/{id}.
Initial status: always pending at submit.
pending, processing, completed, failed, cancelled "pending"
Credits this job is expected to cost (base 5 x num_outputs x resolution multiplier).
5

