Skip to main content
POST
/
api
/
v1
/
client
/
txt2img
cURL
curl --request POST \
  --url https://api.deapi.ai/api/v1/client/txt2img \
  --header 'Accept: <accept>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A beautiful sunset over mountains",
  "model": "Flux1schnell",
  "width": 512,
  "height": 512,
  "guidance": 7.5,
  "steps": 20,
  "seed": 42,
  "negative_prompt": "blur, darkness, noise",
  "loras": [
    {
      "name": "style_lora",
      "weight": 0.75
    }
  ]
}
'
{
  "data": {
    "request_id": "c08a339c-73e5-4d67-a4d5-231302fbff9a"
  }
}
Text-to-Image generates images from text prompts. The endpoint returns a ready-to-use image URL and a task ID to track processing status. Ideal for apps needing automated image creation.
Prerequisite: To ensure a successful request, you must first 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.

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

Response

ID of the inference request.

data
object

Information from success endpoint