Skip to main content
POST
Stable Diffusion v1.5
Stable Diffusion 1.5, with an optional input image. Every field below that you leave out keeps its default. Option values are the raw tokens listed per field; a numeric token may be sent as a number. Fields the schema does not list pass through to the model unchanged. The exact charge for other settings is in the response’s billing.gems_charged, and the balance at GET /v1/account.

Authorizations

Authorization
string
header
required

An API key from Settings → API, sent as Authorization: Bearer mage_sk_…. Keys are for server-side code only.

Headers

Idempotency-Key
string

A key of your choosing, 1 to 255 characters, scoped to your API key. A retried submit with the same key returns the original request with 200 instead of charging again. The key identifies the first submission made with it; later bodies are not compared. A refusal recorded under the key (its envelope carries request_id) replays the same way, so a new attempt needs a new key.

Required string length: 1 - 255

Body

application/json

A partial config for Stable Diffusion v1.5.

prompt
string
required

The text prompt.

Minimum string length: 1
seed
integer | null

Integer seed for reproducible output; omit or send null for a random seed.

model_id
enum<string>
default:15012C538F503CE2EBFC2C8547B268C75CCDAFF7A281DB55399940FF1D70E21D

The model variant to generate with.

Available options:
15012C538F503CE2EBFC2C8547B268C75CCDAFF7A281DB55399940FF1D70E21D
aspect_ratio
enum<string>
default:portrait

Aspect ratio token.

Available options:
ultrawide,
cinema,
landscape,
computer,
square,
portrait,
tablet,
phone,
ultratall
image

The reference image. An https URL or a data URL.

negative_prompt
string
default:""
num_inference_steps
number
default:20
guidance_scale
number
default:7.5
scheduler
string
default:kdpm2_karras

Response

The request was accepted; poll status_url for the result. A retried submit whose Idempotency-Key was used before answers 200 with the same shape, the original request, and charges nothing.

request_id
string<uuid>
required

The request id, also the id in status_url and cancel_url.

status
enum<string>
required

queued and in_progress are live; completed, failed, and cancelled are final.

Available options:
queued,
in_progress,
completed,
failed,
cancelled
architecture
string
required

The architecture the request generates with.

model_id
string | null
required

The model variant, when the architecture has variants.

created_at
string<date-time>
required

When the request was accepted.

updated_at
string<date-time>
required

When the request last changed.

billing
object
required
result
object | null
required

The output once status is completed, else null.

error
object | null
required

Why the request failed once status is failed, else null.

status_url
string<uri>
required

Poll this URL for the request.

cancel_url
string<uri>
required

POST to this URL to stop the request.

Last modified on September 17, 2026