curl --request POST \
--url https://api.deapi.ai/api/v2/images/generations \
--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,
"seed": 42,
"negative_prompt": "blur, darkness, noise",
"loras": [
{
"name": "PepeFluxSchnellLora",
"weight": 0.75
}
],
"guidance": 7.5,
"steps": 4,
"quality": "medium",
"enhance_prompt": false,
"webhook_url": "https://your-server.com/webhooks/deapi",
"webhook_secret": "a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5"
}
'import requests
url = "https://api.deapi.ai/api/v2/images/generations"
payload = {
"prompt": "A beautiful sunset over mountains",
"model": "Flux1schnell",
"width": 512,
"height": 512,
"seed": 42,
"negative_prompt": "blur, darkness, noise",
"loras": [
{
"name": "PepeFluxSchnellLora",
"weight": 0.75
}
],
"guidance": 7.5,
"steps": 4,
"quality": "medium",
"enhance_prompt": False,
"webhook_url": "https://your-server.com/webhooks/deapi",
"webhook_secret": "a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5"
}
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Accept: '<accept>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: 'A beautiful sunset over mountains',
model: 'Flux1schnell',
width: 512,
height: 512,
seed: 42,
negative_prompt: 'blur, darkness, noise',
loras: [{name: 'PepeFluxSchnellLora', weight: 0.75}],
guidance: 7.5,
steps: 4,
quality: 'medium',
enhance_prompt: false,
webhook_url: 'https://your-server.com/webhooks/deapi',
webhook_secret: 'a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5'
})
};
fetch('https://api.deapi.ai/api/v2/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deapi.ai/api/v2/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A beautiful sunset over mountains',
'model' => 'Flux1schnell',
'width' => 512,
'height' => 512,
'seed' => 42,
'negative_prompt' => 'blur, darkness, noise',
'loras' => [
[
'name' => 'PepeFluxSchnellLora',
'weight' => 0.75
]
],
'guidance' => 7.5,
'steps' => 4,
'quality' => 'medium',
'enhance_prompt' => false,
'webhook_url' => 'https://your-server.com/webhooks/deapi',
'webhook_secret' => 'a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5'
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.deapi.ai/api/v2/images/generations"
payload := strings.NewReader("{\n \"prompt\": \"A beautiful sunset over mountains\",\n \"model\": \"Flux1schnell\",\n \"width\": 512,\n \"height\": 512,\n \"seed\": 42,\n \"negative_prompt\": \"blur, darkness, noise\",\n \"loras\": [\n {\n \"name\": \"PepeFluxSchnellLora\",\n \"weight\": 0.75\n }\n ],\n \"guidance\": 7.5,\n \"steps\": 4,\n \"quality\": \"medium\",\n \"enhance_prompt\": false,\n \"webhook_url\": \"https://your-server.com/webhooks/deapi\",\n \"webhook_secret\": \"a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deapi.ai/api/v2/images/generations")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A beautiful sunset over mountains\",\n \"model\": \"Flux1schnell\",\n \"width\": 512,\n \"height\": 512,\n \"seed\": 42,\n \"negative_prompt\": \"blur, darkness, noise\",\n \"loras\": [\n {\n \"name\": \"PepeFluxSchnellLora\",\n \"weight\": 0.75\n }\n ],\n \"guidance\": 7.5,\n \"steps\": 4,\n \"quality\": \"medium\",\n \"enhance_prompt\": false,\n \"webhook_url\": \"https://your-server.com/webhooks/deapi\",\n \"webhook_secret\": \"a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deapi.ai/api/v2/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A beautiful sunset over mountains\",\n \"model\": \"Flux1schnell\",\n \"width\": 512,\n \"height\": 512,\n \"seed\": 42,\n \"negative_prompt\": \"blur, darkness, noise\",\n \"loras\": [\n {\n \"name\": \"PepeFluxSchnellLora\",\n \"weight\": 0.75\n }\n ],\n \"guidance\": 7.5,\n \"steps\": 4,\n \"quality\": \"medium\",\n \"enhance_prompt\": false,\n \"webhook_url\": \"https://your-server.com/webhooks/deapi\",\n \"webhook_secret\": \"a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"request_id": "c08a339c-73e5-4d67-a4d5-231302fbff9a"
}
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123
}{
"message": "Client account is suspended. If you believe this is a mistake, contact us."
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123
}{
"message": "The selected model does not support Text To Image.",
"errors": {
"model": [
"This model is not available on your plan. Please upgrade to access it."
]
}
}{
"message": "Too Many Attempts."
}Image Generation
Generate an image from a text prompt.
curl --request POST \
--url https://api.deapi.ai/api/v2/images/generations \
--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,
"seed": 42,
"negative_prompt": "blur, darkness, noise",
"loras": [
{
"name": "PepeFluxSchnellLora",
"weight": 0.75
}
],
"guidance": 7.5,
"steps": 4,
"quality": "medium",
"enhance_prompt": false,
"webhook_url": "https://your-server.com/webhooks/deapi",
"webhook_secret": "a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5"
}
'import requests
url = "https://api.deapi.ai/api/v2/images/generations"
payload = {
"prompt": "A beautiful sunset over mountains",
"model": "Flux1schnell",
"width": 512,
"height": 512,
"seed": 42,
"negative_prompt": "blur, darkness, noise",
"loras": [
{
"name": "PepeFluxSchnellLora",
"weight": 0.75
}
],
"guidance": 7.5,
"steps": 4,
"quality": "medium",
"enhance_prompt": False,
"webhook_url": "https://your-server.com/webhooks/deapi",
"webhook_secret": "a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5"
}
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Accept: '<accept>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: 'A beautiful sunset over mountains',
model: 'Flux1schnell',
width: 512,
height: 512,
seed: 42,
negative_prompt: 'blur, darkness, noise',
loras: [{name: 'PepeFluxSchnellLora', weight: 0.75}],
guidance: 7.5,
steps: 4,
quality: 'medium',
enhance_prompt: false,
webhook_url: 'https://your-server.com/webhooks/deapi',
webhook_secret: 'a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5'
})
};
fetch('https://api.deapi.ai/api/v2/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deapi.ai/api/v2/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A beautiful sunset over mountains',
'model' => 'Flux1schnell',
'width' => 512,
'height' => 512,
'seed' => 42,
'negative_prompt' => 'blur, darkness, noise',
'loras' => [
[
'name' => 'PepeFluxSchnellLora',
'weight' => 0.75
]
],
'guidance' => 7.5,
'steps' => 4,
'quality' => 'medium',
'enhance_prompt' => false,
'webhook_url' => 'https://your-server.com/webhooks/deapi',
'webhook_secret' => 'a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5'
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.deapi.ai/api/v2/images/generations"
payload := strings.NewReader("{\n \"prompt\": \"A beautiful sunset over mountains\",\n \"model\": \"Flux1schnell\",\n \"width\": 512,\n \"height\": 512,\n \"seed\": 42,\n \"negative_prompt\": \"blur, darkness, noise\",\n \"loras\": [\n {\n \"name\": \"PepeFluxSchnellLora\",\n \"weight\": 0.75\n }\n ],\n \"guidance\": 7.5,\n \"steps\": 4,\n \"quality\": \"medium\",\n \"enhance_prompt\": false,\n \"webhook_url\": \"https://your-server.com/webhooks/deapi\",\n \"webhook_secret\": \"a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deapi.ai/api/v2/images/generations")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A beautiful sunset over mountains\",\n \"model\": \"Flux1schnell\",\n \"width\": 512,\n \"height\": 512,\n \"seed\": 42,\n \"negative_prompt\": \"blur, darkness, noise\",\n \"loras\": [\n {\n \"name\": \"PepeFluxSchnellLora\",\n \"weight\": 0.75\n }\n ],\n \"guidance\": 7.5,\n \"steps\": 4,\n \"quality\": \"medium\",\n \"enhance_prompt\": false,\n \"webhook_url\": \"https://your-server.com/webhooks/deapi\",\n \"webhook_secret\": \"a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deapi.ai/api/v2/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A beautiful sunset over mountains\",\n \"model\": \"Flux1schnell\",\n \"width\": 512,\n \"height\": 512,\n \"seed\": 42,\n \"negative_prompt\": \"blur, darkness, noise\",\n \"loras\": [\n {\n \"name\": \"PepeFluxSchnellLora\",\n \"weight\": 0.75\n }\n ],\n \"guidance\": 7.5,\n \"steps\": 4,\n \"quality\": \"medium\",\n \"enhance_prompt\": false,\n \"webhook_url\": \"https://your-server.com/webhooks/deapi\",\n \"webhook_secret\": \"a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"request_id": "c08a339c-73e5-4d67-a4d5-231302fbff9a"
}
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123
}{
"message": "Client account is suspended. If you believe this is a mistake, contact us."
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123
}{
"message": "The selected model does not support Text To Image.",
"errors": {
"model": [
"This model is not available on your plan. Please upgrade to access it."
]
}
}{
"message": "Too Many Attempts."
}request_id you can poll via GET /api/v2/jobs/{request_id} or receive via webhooks / WebSockets.
slug, check specific limits and features, and verify LoRA availability. Please omit the LoRA parameter by default during initial testing.POST /v1/images/generations at https://oai.deapi.ai/v1. See OpenAI Compatibility.Authorizations
Sanctum personal access token, sent as Authorization: Bearer <token>. The token is opaque — it carries no claims and no embedded expiry, so do not attempt to decode it. Issue and revoke tokens from your account dashboard.
Headers
application/json Body
Image generation parameters
Every example in this schema is a working set for the model example shown — they are not defaults and not portable. Sizes, step counts, frame counts and frame rates are all per-model: read info.limits and info.defaults for the model you actually intend to use from GET /api/v2/models. Substituting a different model while keeping these values is the most common source of a 422.
The main prompt for image generation
"A beautiful sunset over mountains"
The model to use for image generation. Available models can be retrieved via the GET /api/v2/models endpoint.
"Flux1schnell"
Width of the generated image in pixels. The accepted range is model-specific — read info.limits.min_width/max_width and min_height/max_height for your model from GET /api/v2/models. Some models also publish dimension_multiple or resolution_step: values are snapped DOWN to that grid before validation, so an off-grid size is silently reduced rather than rejected. max_pixels and max_ratio, where present, cap total area and aspect ratio on top of the per-side bounds.
512
Height of the generated image in pixels. The accepted range is model-specific — read info.limits.min_width/max_width and min_height/max_height for your model from GET /api/v2/models. Some models also publish dimension_multiple or resolution_step: values are snapped DOWN to that grid before validation, so an off-grid size is silently reduced rather than rejected. max_pixels and max_ratio, where present, cap total area and aspect ratio on top of the per-side bounds.
512
Random seed for generation
42
Elements to avoid in the generated image
"blur, darkness, noise"
Array of LoRA models to apply. Accepted only by models that publish a loras array in GET /api/v2/models — a LoRA not listed for the selected model is rejected with a 422. The example below belongs to the model example shown and is not portable to another model.
Show child attributes
Show child attributes
Guidance scale. Required only when the model declares info.features.supports_guidance; for a model that does not, the value is accepted and ignored. Bounds are info.limits.min_guidance / max_guidance, from GET /api/v2/models.
7.5
Number of inference steps. Required when the model publishes step bounds: send it if info.limits.min_steps / max_steps or info.defaults.steps is present for your model in GET /api/v2/models, and stay inside that range. Key off those fields rather than info.features.supports_steps, which some models omit while still using steps.
4
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. Accepted values are model-specific — read info.limits.quality_options for your model from GET /api/v2/models. A model with an empty or absent list does not support a quality tier and ignores the field.
"medium"
When true, the prompt is boosted by the inline prompt booster before generation (async pre-step). Requires a prompt-booster guide configured for the model; the boost fee is billed on the job. Rejected with 422 if no guide exists for the model or the account balance cannot cover the boost fee.
false
Optional HTTPS URL to receive webhook notifications for job status changes (processing, completed, failed). Must be HTTPS. Max 2048 characters. A per-request URL is self-contained: it is delivered even when the account has no webhook configuration, or the account webhook is disabled. See the webhooks block at the top level of this document for the event payloads and the headers each delivery carries.
2048"https://your-server.com/webhooks/deapi"
Optional per-request HMAC secret (min. 32 chars) used to sign the webhook callback. Overrides the account-default secret for this job only. If omitted, the account-default secret signs the callback; if no secret exists at all, the callback is still delivered but UNSIGNED (empty X-DeAPI-Signature header). Requires webhook_url to also be set.
32 - 255"a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5"
Response
ID of the inference request.
Information from success endpoint
Show child attributes
Show child attributes
Was this page helpful?