Skip to main content
POST
cURL
Image Generation creates images from text prompts using AI diffusion models. The endpoint returns a request_id you can poll via GET /api/v2/jobs/{request_id} or receive via webhooks / WebSockets.
Prerequisite: Consult the Model Selection endpoint to identify a valid model slug, check specific limits and features, and verify LoRA availability. Please omit the LoRA parameter by default during initial testing.
OpenAI SDK users: This endpoint is also available via the OpenAI-compatible surface as POST /v1/images/generations at https://oai.deapi.ai/v1. See OpenAI Compatibility.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Accept
enum<string>
default:application/json
required
Available options:
application/json

Body

application/json

Image generation parameters

prompt
string
required

The main prompt for image generation

Example:

"A beautiful sunset over mountains"

model
string
required

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

Example:

"Flux1schnell"

width
integer
required

Width of the generated image in pixels

Example:

512

height
integer
required

Height of the generated image in pixels

Example:

512

guidance
number
required

Guidance scale for the generation

Example:

7.5

steps
integer
required

Number of inference steps

Example:

20

seed
integer
required

Random seed for generation

Example:

42

negative_prompt
string | null

Elements to avoid in the generated image

Example:

"blur, darkness, noise"

loras
object[]

Array of LoRA models to apply

quality
string | null

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.

Example:

"medium"

webhook_url
string<uri> | null

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.

Maximum string length: 2048
Example:

"https://your-server.com/webhooks/deapi"

webhook_secret
string | null

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.

Required string length: 32 - 255
Example:

"a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5"

Response

ID of the inference request.

data
object

Information from success endpoint