Variationen generieren
Reiche einen Variations-Job ein — ein Quellbild, optional gesteuert — und erhalte eine Job-id zurück.
image. Der Aufruf gibt
202 Accepted mit einer Job-id zurück; frage
GET /images/variations/{id} nach dem
Ergebnis ab. Das image nimmt genau eines von image_id, url oder
base64 + mime_type. Erfordert den images.transform-Scope.
Beispiel: eine Quelle pro Modus
202-Antwort ist das asynchrone Job-Handle:
image. target — was die Variationen ändern
dürfen — ist everything (Standard), person, object oder scene.
creativity ist subtle oder creative (Standard). variation_instructions
(was geändert werden soll) und preservation_instructions (was erhalten bleiben
soll) sind optionaler Freitext, jeweils ≤ 2000 Zeichen. num_outputs (1–4) ist
standardmäßig 1 und jedes Ergebnis (output) wird abgerechnet. Es gibt keinen
resolution-Parameter — die Ausgabeauflösung wird von der Quelle geerbt.Credits
Jedes Ergebnis (output) kostet5 Credits bei 1K und skaliert mit der
Auflösungsstufe des Quellbildes (1K ×1, 2K ×2, 4K ×4), multipliziert mit
num_outputs. Siehe Preise.
Fehler
Autorisierungen
Organization API key as a bearer token: Authorization: Bearer samsa_sk_....
Body
POST /images/variations body (SAM-816 / S8.4 — ADR §8, §10).
Generate creative variations of ONE source image (the app's Gemini 3 Pro
variations flow). The source is exactly one of image_id (an image in your
organization's context), an https url, or base64+mime_type. The output
resolution is inherited from the source (there is no resolution param);
each output is billed at 5 x resolution_multiplier credits (1K:1x, 2K:2x,
4K:4x) where the multiplier is the source image's resolution tier. target
and creativity are lowercase public aliases of the internal Gemini
variation controls; num_outputs defaults to 1 (the app default is 4).
The source image: exactly one of image_id, url, or base64+mime_type.
What the variations may change: everything (default), person, object, or scene.
everything, person, object, scene "everything"
How far the variations may deviate from the source: subtle or creative (default).
subtle, creative "creative"
Optional free-text guidance for WHAT to change (<= 2000 chars).
2000"Try different background colors and lighting"
Optional free-text guidance for WHAT to keep (<= 2000 chars).
2000"Keep the product label and shape unchanged"
Number of variations to generate (1-4). Defaults to 1 (the app default is 4); each output is billed.
1 <= x <= 41
Optional https webhook notified once on terminal status (signed per the webhook signature scheme; see the webhooks docs).
"https://example.com/webhooks/samsa"
Antwort
Successful Response
Shared 202 body for the transform-op submits (SAM-813 / S8 wave).
Every POST /images/<op> returns the async job handle
{id, status, estimated_credits}. The initial status is pending (the
job is queued), with ONE exception: background-removals and
vectorizations answer an owned-image_id cache hit (a ready result
already exists for that image) with status: "completed" and
estimated_credits: 0 — no new job is queued, the completed webhook
event is emitted immediately for a supplied webhook_url, and the result
is already available from the op's GET .../{id} endpoint. The other
transform ops (img2img, variations, resizes, upscales) always
start pending.
The job id — poll the op's GET .../{id} endpoint.
Initial status: pending (job queued — enter the polling flow), or completed with estimated_credits: 0 when background-removals / vectorizations serve an owned-image cache hit (the result is immediately available).
pending, processing, completed, failed, cancelled "pending"
Credits this job is expected to cost — 0 on a cache-hit completed response.
5

