Skip to main content
POST
/
api
/
v2
/
prompts
/
enhancements
cURL
curl --request POST \
  --url https://api.deapi.ai/api/v2/prompts/enhancements \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'prompt=A beautiful landscape with mountains' \
  --form 'negative_prompt=blurry, low quality' \
  --form type=images.generations \
  --form model_slug=Flux1schnell \
  --form 'image=<string>' \
  --form image.0='@example-file' \
  --form image.1='@example-file'
import requests

url = "https://api.deapi.ai/api/v2/prompts/enhancements"

files = {
"image.0": ("example-file", open("example-file", "rb")),
"image.1": ("example-file", open("example-file", "rb"))
}
payload = {
"prompt": "A beautiful landscape with mountains",
"negative_prompt": "blurry, low quality",
"type": "images.generations",
"model_slug": "Flux1schnell",
"image": "<string>"
}
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.text)
const form = new FormData();
form.append('prompt', 'A beautiful landscape with mountains');
form.append('negative_prompt', 'blurry, low quality');
form.append('type', 'images.generations');
form.append('model_slug', 'Flux1schnell');
form.append('image', '<string>');
form.append('image.0', '{
"fileName": "example-file"
}');
form.append('image.1', '{
"fileName": "example-file"
}');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

fetch('https://api.deapi.ai/api/v2/prompts/enhancements', 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/prompts/enhancements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nA beautiful landscape with mountains\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"negative_prompt\"\r\n\r\nblurry, low quality\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nimages.generations\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_slug\"\r\n\r\nFlux1schnell\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image.1\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);

$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/prompts/enhancements"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nA beautiful landscape with mountains\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"negative_prompt\"\r\n\r\nblurry, low quality\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nimages.generations\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_slug\"\r\n\r\nFlux1schnell\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image.1\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")

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/prompts/enhancements")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nA beautiful landscape with mountains\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"negative_prompt\"\r\n\r\nblurry, low quality\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nimages.generations\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_slug\"\r\n\r\nFlux1schnell\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image.1\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.deapi.ai/api/v2/prompts/enhancements")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nA beautiful landscape with mountains\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"negative_prompt\"\r\n\r\nblurry, low quality\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nimages.generations\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_slug\"\r\n\r\nFlux1schnell\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image.0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image.1\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"

response = http.request(request)
puts response.read_body
{
  "prompt": "<string>",
  "negative_prompt": "<string>"
}
{
"data": {},
"message": "<string>",
"errors": [
{
"field": "<string>",
"messages": [
"<unknown>"
]
}
],
"statusCode": 123
}
Enhance a raw user prompt into a detailed, model-friendly prompt using the AI guide that matches the target model and inference type.
  • Set type (v2 dot notation) and model_slug to pick the right guide.
  • For images.edits and videos.animations, also send the source image (URL, data-URI, base64, or file).
  • Synchronous — the enhanced prompt is returned directly in the response body ({ prompt, negative_prompt }).
Required fields: prompt, type, model_slug (plus image for images.edits / videos.animations). The returned negative_prompt is provided for compatibility and is ignored by models that do not support negative prompts (e.g. FLUX.2 Klein).

Accepted type values

images.generations, images.edits, images.upscales, images.background-removals, images.ocr, videos.generations, videos.animations, videos.upscales, videos.background-removals, videos.transcriptions, audio.speech, audio.music, audio.transcriptions, embeddings

Example (image-to-image)

curl -X POST "https://api.deapi.ai/api/v2/prompts/enhancements" \
  -H "Authorization: Bearer <TOKEN>" \
  -F "prompt=Make it look like a digital photo" \
  -F "type=images.edits" \
  -F "model_slug=Flux_2_Klein_4B_BF16" \
  -F "image=@source.jpg"
Then send the returned prompt to the matching generation endpoint (e.g. POST /api/v2/images/edits).

Authorizations

Authorization
string
header
required

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

Body

multipart/form-data
prompt
string
Minimum string length: 3
Example:

"A beautiful landscape with mountains"

negative_prompt
string | null
Minimum string length: 3
Example:

"blurry, low quality"

type
string

Inference type in v2 dot notation (e.g. images.generations, videos.animations, audio.speech)

Example:

"images.generations"

model_slug
string
Example:

"Flux1schnell"

image
file | null

Reference image. Required for images.edits/videos.animations. Supported formats: JPEG, PNG, BMP, GIF, WebP.

Response

Enhanced prompts returned successfully

prompt
string
negative_prompt
string | null