v1

latestOpenAPI 3.0.02026-07-228239173.7 KB
Client API v2

Generate an image from a text prompt.

post/api/v2/images/generations

Headers

Accept'application/json' required

Request body

promptstring required

The main prompt for image generation

negative_promptstring nullable

Elements to avoid in the generated image

modelstring required

The model to use for image generation. Available models can be retrieved via the GET /api/v1/client/models endpoint.

widthinteger required

Width of the generated image in pixels

heightinteger required

Height of the generated image in pixels

guidancenumber required

Guidance scale for the generation

stepsinteger required

Number of inference steps

qualitystring nullable

Quality tier, for models that support one (e.g. gpt-image: low/medium/high/auto). Only the values listed in that model's available options are accepted; ignored for models without a quality tier.

seedinteger required

Random seed for generation

webhook_urlstring uri nullable

Optional HTTPS URL to receive webhook notifications for job status changes (processing, completed, failed). Must be HTTPS. Max 2048 characters. See Webhook Documentation for payload structure and authentication details.

webhook_secretstring nullable

Optional per-request HMAC secret (min. 32 chars) used to sign the webhook callback. When present, overrides the account-default webhook secret. Requires webhook_url to also be set.

Example request

{
  "prompt": "A beautiful sunset over mountains",
  "negative_prompt": "blur, darkness, noise",
  "model": "Flux1schnell",
  "loras": [
    {
      "name": "style_lora",
      "weight": 0.75
    }
  ],
  "width": 512,
  "height": 512,
  "guidance": 7.5,
  "steps": 20,
  "quality": "medium",
  "seed": 42,
  "webhook_url": "https://your-server.com/webhooks/deapi",
  "webhook_secret": "a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5"
}

Response

ID of the inference request.

Example response

{
  "data": {
    "request_id": "c08a339c-73e5-4d67-a4d5-231302fbff9a"
  }
}