Skip to content

Generate an image from a text prompt

POST
/v1/generate/image

Generate an image from a text prompt. This is the general-purpose endpoint — use it for photos, illustrations, art, or anything that isn’t specifically an icon/graphic, diagram, or story.

The prompt goes through content moderation first. If it passes, the image is generated using the specified model, watermarked with C2PA metadata (EU AI Act compliance), and uploaded to temporary storage.

The response includes signed URLs in multiple formats (PNG, JPEG, WebP) valid for 1 hour — download what you need before they expire. You also get the cost charged and your remaining balance.

Use GET /v1/models to see which models are available and what they cost.

Recovery: Every generation is tracked as a job. The response includes an X-Depicta-Job-Id header with the job UUID. If the response is lost (network error, timeout), use GET /v1/jobs to find your recent generations — the result will be there once the generation completes.

Media type application/json
object
aspect_ratio

Desired aspect ratio of the output image: one of the model’s aspect_ratios or fixed_sizes from GET /v1/models, up to 16 characters. Another value returns 422 validation_error before anything is charged.

null | string
<= 16 characters
image_size

Size tier, one of the model’s image_sizes from GET /v1/models (e.g. 1K, 2K, 4K), up to 8 characters. Omit for the model’s default size. Another value returns 422 validation_error before anything is charged.

null | string
<= 8 characters
model

Model identifier or alias from GET /v1/models. Optional: when omitted, your default_model preference is used if it supports the operation, otherwise the recommended model for the operation (create: mai-fast; graphic and diagram: mai; edit and combine: gemini). The response’s model field names the model used.

string
prompt
required

Text prompt describing the image to generate.

string
reference_images

Optional reference images for visual style/context anchoring. Max 5.

Array<object>
object
description
required

What this image shows. The model uses this to understand what to reference.

string
url
required

HTTPS URL of the reference image. Must be publicly accessible.

string
strictness

Classification strictness mode override for this request: ‘normal’ (brand-safe) or ‘liberal’. Liberal: For erotic and provocative art of fictional adults, and dark themes. Explicit sexual content is never allowed, and nothing sexual of real people or of anyone who could be a minor. Omit to use your account default.

null | string
Allowed values: normal liberal

OK

Media type application/json
object
ai_generated

Always true. Indicates AI-generated content per EU AI Act Art. 50.

boolean
balance_eur

Remaining balance after this generation, in credits (EUR, excluding VAT).

string
characters

Character reference images produced during story generation. Omitted for non-story operations.

Array<object>
object
expires_at

ISO 8601 expiry time of the reference URL. Null for client-provided refs.

null | string
name

Character name as provided in the story request.

string
reference_url

Signed URL of the character reference image. Expires in 1 hour.

string
cost_eur

Actual cost charged, in credits (EUR, excluding VAT).

string
formats

Per-format variants (png, jpeg, webp) with individual URLs and hashes. Omitted when not available.

object
key
additional properties
object
expires_at

ISO 8601 expiry time of the signed URL.

string
format

Image format identifier.

string
hash

SHA-256 hash of the image in this format for provenance verification.

string
size_bytes

File size in bytes of the image in this format.

integer
url

Signed URL for this format variant. Expires in 1 hour.

string
id

Unique generation identifier.

string format: uuid
image_hash

SHA-256 hash of the generated image (PNG) for provenance verification.

string
image_hashes

SHA-256 hashes for multi-image operations (stories). Omitted for single-image operations.

Array<string>
image_url

Signed URL of the generated image (PNG). Expires in 1 hour. Omitted for story operations.

string
image_urls

Signed URLs for multi-image operations (e.g. combine). Each URL expires in 1 hour.

Array<string>
locations

Location reference images used during story generation (auto-generated or client-provided). Reusable for standalone scene regeneration. Omitted for non-story operations.

Array<object>
object
expires_at

ISO 8601 expiry time of the reference URL. Null for client-provided refs.

null | string
name

Location name as provided in the story request.

string
reference_url

Signed URL of the location reference image. Expires in 1 hour.

string
model

Resolved model identifier used for this generation.

string
scenes

Scene images for story operations. Each entry includes image URL, title, and expiry. Omitted otherwise.

Array<object>
object
expires_at

ISO 8601 expiry time of the signed URL.

string
formats

Per-format variants (png, jpeg, webp) with individual URLs and hashes. Omitted when not available.

object
key
additional properties
object
expires_at

ISO 8601 expiry time of the signed URL.

string
format

Image format identifier.

string
hash

SHA-256 hash of the image in this format for provenance verification.

string
size_bytes

File size in bytes of the image in this format.

integer
url

Signed URL for this format variant. Expires in 1 hour.

string
image_hash

SHA-256 hash of the scene image (PNG) for provenance verification.

string
image_url

Signed URL of the scene image (PNG). Expires in 1 hour.

string
scene

1-based scene index within the story.

integer
title

Short generated title for this scene.

string
title

Generated story title. Present only for story operations.

string

Bad Request

Media type application/json
object
details
error
string
message
string
request_id
string

Unauthorized

Media type application/json
object
details
error
string
message
string
request_id
string

Payment Required

Media type application/json
object
details
error
string
message
string
request_id
string

Forbidden

Media type application/json
object
details
error
string
message
string
request_id
string

Not Found

Media type application/json
object
details
error
string
message
string
request_id
string

Conflict

Media type application/json
object
details
error
string
message
string
request_id
string

Unprocessable Entity

Media type application/json
object
details
error
string
message
string
request_id
string

Too Many Requests

Media type application/json
object
details
error
string
message
string
request_id
string

Unavailable For Legal Reasons

Media type application/json
object
details
error
string
message
string
request_id
string

Internal Server Error

Media type application/json
object
details
error
string
message
string
request_id
string

Bad Gateway

Media type application/json
object
details
error
string
message
string
request_id
string

Service Unavailable

Media type application/json
object
details
error
string
message
string
request_id
string