v1

latestOpenAPI 3.0.32026-07-24205887.6 KB
Image Generations

Create image generation

Submit an image-generation request. The caller's prompt is treated as a creative brief: Atria expands it into size distinct concept variants and renders one image per variant. size > 1 returns real creative variety, not seed-jittered copies of the same prompt.

Treat prompt as a directional brief (intent, audience, mood, visual hints), not the final image-model prompt — Atria produces the per-variant prompts internally.

Async. Returns immediately with a generation_id and (initially empty) image_ids. Poll GET /open/v1/image-generations/{generation_id} to pick up image ids and track status; see that endpoint for cadence guidance.

Brand required. brand_id must reference a workspace-owned brand from GET /open/v1/owned-brands. The brand's logo / colors / product context grounds the brief — there is no placeholder fallback. Cross-workspace brand ids return code=40401.

Idempotency. idempotency_key deduplicates retries — re-submitting the same key from the same workspace returns the same generation_id and never produces a duplicate charge. Pick a stable UUID per attempt; reuse only to recover from a dropped response.

Credits. Charged at the same rate as the in-app image generation feature — trigger one image in Atria's web app to see the current per-image credit cost; size multiplies it. Credits are reserved on submit; per-image failures are auto-refunded.

Errors: code=40001 when workspace context is missing from the request; code=40401 for unknown / cross-workspace brand_id; code=50001 when the upstream image-gen service is unavailable, returns an error envelope, or rejects the submit (including credit-exhaustion at the upstream layer).

post/open/v1/image-generations

Request body

idempotency_keystring required

Caller-supplied dedupe key. Re-submitting with the same idempotency_key from the same workspace returns the same generation_id without spawning new images. Pick a stable UUID per attempt; reuse only to retry a specific submission.

reference_image_urlstring

Optional URL of a reference ad image to ground the output. When omitted, generation runs as pure text-to-image from the brief alone.

promptstring required

Creative brief / direction. Atria expands this into size distinct concept variants and renders one image per variant. Treat this as a directional brief, not the final image-model prompt.

brand_idstring required

Workspace-owned brand id from GET /open/v1/owned-brands. The brand's logo / colors / product context grounds the brief; cross-workspace brand ids return code=40401.

aspect_ratio'auto_closest_fit' | '1:1' | '4:5' | '9:16'

An enumeration.

sizeinteger

Number of distinct concept variants to generate (1-20). Each variant produces one image.

languagestring

Output text language. Defaults to English.

logo_urlstring

Override logo URL. When omitted, uses the brand's stored logo.

product_image_urlsstring[]

Product images to include in generation.

colorsstring[]

Color palette overrides (hex). Falls back to brand colors.

source_refstring

Caller's own correlation id, persisted alongside the generation for cross-system tracking. Defaults to the idempotency_key when omitted.

Response

Successful Response

codeinteger
messagestring