Image Generation
curl --request POST \
--url https://api.example.com/api/v2/generate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"negative_prompt": "<string>",
"size": "<string>",
"format": "<string>",
"quality": "<string>",
"style": "<string>",
"seed": 123,
"image_url": "<string>"
}
'import requests
url = "https://api.example.com/api/v2/generate"
payload = {
"model": "<string>",
"prompt": "<string>",
"negative_prompt": "<string>",
"size": "<string>",
"format": "<string>",
"quality": "<string>",
"style": "<string>",
"seed": 123,
"image_url": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
negative_prompt: '<string>',
size: '<string>',
format: '<string>',
quality: '<string>',
style: '<string>',
seed: 123,
image_url: '<string>'
})
};
fetch('https://api.example.com/api/v2/generate', 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.example.com/api/v2/generate",
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([
'model' => '<string>',
'prompt' => '<string>',
'negative_prompt' => '<string>',
'size' => '<string>',
'format' => '<string>',
'quality' => '<string>',
'style' => '<string>',
'seed' => 123,
'image_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.example.com/api/v2/generate"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"format\": \"<string>\",\n \"quality\": \"<string>\",\n \"style\": \"<string>\",\n \"seed\": 123,\n \"image_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.example.com/api/v2/generate")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"format\": \"<string>\",\n \"quality\": \"<string>\",\n \"style\": \"<string>\",\n \"seed\": 123,\n \"image_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"format\": \"<string>\",\n \"quality\": \"<string>\",\n \"style\": \"<string>\",\n \"seed\": 123,\n \"image_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"status": "<string>",
"result_url": "<string>",
"tokens_spent": 123,
"seed": 123
}Generations (results)
Image Generation
Generate images with DALL-E 3, Midjourney, Flux, Stable Diffusion, and more
POST
/
api
/
v2
/
generate
Image Generation
curl --request POST \
--url https://api.example.com/api/v2/generate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"negative_prompt": "<string>",
"size": "<string>",
"format": "<string>",
"quality": "<string>",
"style": "<string>",
"seed": 123,
"image_url": "<string>"
}
'import requests
url = "https://api.example.com/api/v2/generate"
payload = {
"model": "<string>",
"prompt": "<string>",
"negative_prompt": "<string>",
"size": "<string>",
"format": "<string>",
"quality": "<string>",
"style": "<string>",
"seed": 123,
"image_url": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
negative_prompt: '<string>',
size: '<string>',
format: '<string>',
quality: '<string>',
style: '<string>',
seed: 123,
image_url: '<string>'
})
};
fetch('https://api.example.com/api/v2/generate', 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.example.com/api/v2/generate",
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([
'model' => '<string>',
'prompt' => '<string>',
'negative_prompt' => '<string>',
'size' => '<string>',
'format' => '<string>',
'quality' => '<string>',
'style' => '<string>',
'seed' => 123,
'image_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.example.com/api/v2/generate"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"format\": \"<string>\",\n \"quality\": \"<string>\",\n \"style\": \"<string>\",\n \"seed\": 123,\n \"image_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.example.com/api/v2/generate")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"format\": \"<string>\",\n \"quality\": \"<string>\",\n \"style\": \"<string>\",\n \"seed\": 123,\n \"image_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"format\": \"<string>\",\n \"quality\": \"<string>\",\n \"style\": \"<string>\",\n \"seed\": 123,\n \"image_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"status": "<string>",
"result_url": "<string>",
"tokens_spent": 123,
"seed": 123
}Request
string
required
Authorization: Bearer nb_YOUR_API_KEYstring
required
Image model slug. See Image Models.Popular options:
dall-e-3, flux-1.1-pro, midjourney-v6, midjourney-turbo, sd-3.5-largestring
required
Text description of the image to generate.
string
What to exclude from the image. Supported by Flux, SD, Midjourney models.
string
default:"1024x1024"
Image dimensions. Available options depend on the model:
| Model | Available sizes |
|---|---|
| DALL-E 3 | 1024x1024, 1024x1792, 1792x1024 |
| Flux 1.1 Pro | 1024x1024, 768x1344, 1344x768, 1024x1536, 1536x1024 |
| Midjourney V6 / Turbo | 1:1, 2:3, 3:2, 9:16, 16:9 (aspect ratios) |
| SD 3.5 Large | 1024x1024, 768x1344, 1344x768 |
string
default:"webp"
Output format:
webp, png, jpegstring
default:"standard"
Quality preset:
standard or hd. Affects cost on DALL-E 3 and GPT Image.string
Style hint for compatible models (
vivid or natural for DALL-E 3).integer
Random seed for reproducible results. Pass the same seed with the same prompt to get similar outputs.
string
Input image URL for image-to-image generation (supported by Flux Kontext, SD Inpaint).
Request Example
curl -X POST https://elumenta.ru/api/v2/generate \
-H "Authorization: Bearer nb_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dall-e-3",
"prompt": "A cozy coffee shop on a rainy evening, warm lighting, impressionist style",
"size": "1024x1024",
"format": "webp"
}'
curl -X POST https://elumenta.ru/api/v2/generate \
-H "Authorization: Bearer nb_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-1.1-pro",
"prompt": "Portrait of a CEO in a modern office, professional photography, Canon 5D",
"negative_prompt": "blurry, low quality, distorted",
"size": "768x1344",
"format": "webp",
"seed": 42
}'
curl -X POST https://elumenta.ru/api/v2/generate \
-H "Authorization: Bearer nb_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "midjourney-v6",
"prompt": "Ethereal forest at dawn, soft bokeh, film photography --ar 2:3 --stylize 100",
"size": "2:3"
}'
import requests
res = requests.post(
"https://elumenta.ru/api/v2/generate",
headers={"Authorization": "Bearer nb_YOUR_API_KEY"},
json={
"model": "flux-1.1-pro",
"prompt": "Minimalist product photo of a black sneaker on white background",
"negative_prompt": "shadow, text, watermark",
"size": "1024x1024",
"format": "webp"
}
)
data = res.json()
print(f"Image URL: {data['result_url']}")
print(f"Tokens used: {data['tokens_spent']}")
Response
integer
Unique generation ID.
string
completed | pending | failedstring
Direct URL to the generated image. Files are stored for the duration matching your plan (Free: 7 days, Basic: 30 days, Pro/VIP: 90 days, Elite: unlimited).
integer
Elumenta tokens consumed.
integer
The seed used (useful if you didn’t specify one and want to reproduce the result).
Response Example
{
"id": 18491,
"status": "completed",
"model_slug": "flux-1.1-pro",
"result_url": "https://storage.elumenta.ru/generations/18491.webp",
"tokens_spent": 4,
"result_metadata": { "width": 768, "height": 1344 },
"created_at": "2026-03-08T12:02:30Z"
}
Async Generation (MidJourney)
MidJourney returnsstatus: "pending" initially. Poll until complete:
{
"id": 18495,
"status": "pending",
"model_slug": "midjourney",
"eta_seconds": 45
}
GET /api/v2/generate/{id}
See Generation Status for details.
Non-square Pricing Note
DALL-E 3 and GPT Image 1.5 charge more for non-square aspect ratios (e.g. 1024×1792 costs up to 2× more). Use the Calculate Price endpoint to check exact token cost before generating.
⌘I

