Skip to main content
POST
Generate an image into the media library asynchronously

Authorizations

Authorization
string
header
required

Pass Authorization: Bearer scripe_sk_live_<...> (or scripe_sk_test_<...> for test keys) on every request. Keys are scoped to a single workspace and can be revoked from the Scripe dashboard.

The same header also accepts an OAuth 2.1 access token (scripe_oat_*); both credentials share one scope vocabulary and every operation below documents the scope it requires. An API key can hold every scope named on this surface except webhooks:manage, which is grantable to OAuth tokens only today — the webhook-endpoint operations answer 403 scope_missing to every API key. Operations that name no scope accept any valid token of the workspace.

Headers

Scripe-Api-Version
string

Pin the API version. Format YYYY-MM-DD. Omit to receive the currently rolling default. Unknown versions return 400 version_unsupported.

Example:

"2026-08-10"

Idempotency-Key
string

Opaque string (1–64 chars, [A-Za-z0-9_-]) used to dedup retried writes. Within 24h of the first request, the same key

  • same body returns the original response (Idempotent-Replayed: true). Same key + different body returns 409 idempotency_key_conflict.

Strongly recommended for every write — see /docs/api/v1/idempotency.

Pattern: ^[A-Za-z0-9_-]{1,64}$

Body

application/json
projectId
string
required
Example:

"proj_a1b2c3d4e5f6g7h8"

kind
enum<string>
required

PHOTO: original AI image (optionally style-referenced). PHOTO_EDIT: compose the author's own photo(s) into a desired look. IMAGE_EDIT: targeted in-place tweak of an existing generated image.

Available options:
PHOTO,
PHOTO_EDIT,
IMAGE_EDIT
promptAsset
string

Styling/format instructions — look-and-feel only. On PHOTO and PHOTO_EDIT the workspace's saved branding is available material: it is applied when the instructions ask for it (for example "in our branding"), never forced onto a run that asked for a different look.

Maximum string length: 4000
subject
string

The core idea/intention the visual communicates.

Maximum string length: 4000
steer
string

Explicit instruction that takes priority. For IMAGE_EDIT this is the change to apply.

Maximum string length: 4000
referenceMode
enum<string>

PHOTO only. style (default) draws loose inspiration from the references; replicate faithfully recreates their composition.

Available options:
style,
replicate
referenceMediaIds
string[]

Up to 3 media ids used as style/look references. Media ids only — URLs are never accepted.

Maximum array length: 3
subjectMediaIds
string[]

PHOTO_EDIT only: the author's own photo(s) whose likeness must be preserved.

Maximum array length: 2
baseMediaId
string

IMAGE_EDIT only: the generated image to edit in place. Must belong to the project itself.

Example:

"img_a1b2c3d4e5f6g7h8"

wait_for_completion_ms
integer

Soft hint — server polls for up to this many ms before returning. Capped at 25 000 ms. Larger values are silently clamped.

Required range: 0 <= x <= 25000

Response

Job enqueued (or finished, on a sync-wait hit).

data
object
required