Skip to main content
POST
Generate AI image
Starts AI image generation into the site’s Media Library and returns 202 with the image_id — the Media Library asset id — as soon as the job is queued. Poll Get image or subscribe to the image.generation.completed / image.generation.failed webhook events. Pass asset_id to regenerate an existing generated image in place (same image_id, new render). Scope required: images:write
Plan entitlement (IMAGE_GENERATION) is checked before anything is created. A site without access receives 403 plan_upgrade_required with required_plan in the error details, and no asset or job is created.

Request body

string
required
What to render — subject, setting, mood — in plain language (max 8,000 chars). Hrizn handles model prompting and the E-E-A-T disclaimer.
string
"16:9", "1:1", "4:5", etc. Defaults to landscape.
string
Attach the image to a Hrizn content item as an article image.
string
Existing generated image to regenerate in place.
string[]
Up to 4 Media Library asset keys used as visual references.
string
Alternative to the X-Idempotency-Key header. Replays with the same key return the same image_id without a second render.
Image generation usually finishes in under a minute. Configure webhooks for image.generation.completed (payload includes asset_id and image_url) rather than polling.

Authorizations

X-API-Key
string
header
required

Your Hrizn API key (prefix hzk_)

Headers

X-Idempotency-Key
string

Optional idempotency key. Repeats with the same key + body within 24h return the original response instead of creating a duplicate.

Body

application/json
prompt
string
required

What to render (subject, setting, mood) in plain language.

Maximum string length: 8000
Example:

"A silver mid-size SUV parked outside a dealership at golden hour"

aspect_ratio
string

e.g. "16:9", "1:1", "4:5". Defaults to landscape.

Maximum string length: 16
Example:

"16:9"

article_id
string<uuid> | null

Attach the image to a Hrizn content item as an article image.

asset_id
string<uuid> | null

Existing generated image to regenerate in place.

reference_image_keys
string[]

Media Library asset keys used as visual references.

Maximum array length: 4
idempotency_key
string

Alternative to the X-Idempotency-Key header.

Maximum string length: 200

Response

Image generation started

data
object
Last modified on September 6, 2026