Generation

Generate an image (logged-in): a prepaid credit, else a Lightning offer

A standard generation consumes ONE prepaid generation credit when the account holds one (answered 201 with the job dispatched); otherwise — and always for quality and edit — answers a 402 Lightning offer for the mode's price ($0.08 standard / $0.20 quality / $0.15 edit, invoiced in sats at the current BTC/USD rate), to be paid and then redeemed at POST /v1/images/generate/redeem. edit takes up to 3 references: existing image ids (ref_image_ids) and/or ephemeral uploads (ref_upload_ids from /v1/images/generate/ref-upload). Idempotency-Key is REQUIRED — the credit arm is a mutation, and a same-key retry of a 402 hands back the SAME offer rather than minting a second invoice. Requires a fresh account. Rate limited 20/min/user. Returns 403 while IMAGE_GEN_ENABLED is off.

post/v1/images/generate

Request

  • Base URL: https://api.memestack.ai
  • URL: https://api.memestack.ai/v1/images/generate
  • Auth: HTTP bearer

Headers

Idempotency-Keystring required

Client-generated key (e.g. crypto.randomUUID()). A replayed key returns the original response; missing header is a 400 MISSING_IDEMPOTENCY_KEY.

Request body

mode'standard' | 'quality' | 'edit' required
promptstring required
aspect_ratio'1:1' | '3:4' | '16:9' required
ref_image_idsstring[]

edit only — existing images the caller may access.

ref_upload_idsstring[]

edit only — ids returned by /v1/images/generate/ref-upload.

Response

A prepaid credit covered the generation; the job is dispatched. Poll GET /v1/images/{id}/generation-status.

imageIdstring uuid
status'generating'
cost_sats0
paid_with'credit'
generation_creditsinteger

Credits remaining after this one.

Changes

No recorded changes to this operation across all 1 revision of this API.