Image Generation
curl --request POST \
--url https://api.example.com/api/v2/generateimport requests
url = "https://api.example.com/api/v2/generate"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
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",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/generate"
req, _ := http.NewRequest("POST", url, nil)
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")
.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)
response = http.request(request)
puts response.read_bodyGenerations (results)
Image Generation
Image Generation
POST
/
api
/
v2
/
generate
Image Generation
curl --request POST \
--url https://api.example.com/api/v2/generateimport requests
url = "https://api.example.com/api/v2/generate"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
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",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/generate"
req, _ := http.NewRequest("POST", url, nil)
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")
.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)
response = http.request(request)
puts response.read_bodyUse GPT Image 2.5 Flare for everyday generation and editing; Sunburst targets detailed compositions. The 2.6 variants are separate choices with their own prices. Read
Put controls inside
Before generating, calculate the price using the same controls and
/api/v2/models?category=image for actual availability.
| Model | Base: 1:1, 1MP, low, one image (tokens) |
|---|---|
gpt-image-2.5-flare | 1 |
gpt-image-2.5-sunburst | 1 |
gpt-image-2.6-flare | 3 |
gpt-image-2.6-sunburst | 3 |
curl -X POST https://elumenta.ru/api/v2/generate \
-H "Authorization: Bearer nb_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.5-flare",
"prompt": "A red cup on a blue table, no lettering",
"params": {
"quality": "low",
"aspect_ratio": "1:1",
"resolution": "1MP",
"output_format": "webp",
"count": 1
}
}'
params, rather than at the request top level.
| Control | First-phase support |
|---|---|
quality | low, medium, high |
aspect_ratio | 13 catalog values, from 1:3 to 3:1 |
resolution | 1MP, 4MP, max; pixel-area presets, not a promise of a 4096 px edge |
count | 1–10 images; quote the whole requested count |
output_format | webp, png, jpeg |
background | auto, opaque |
output_compression | 0–100 for JPEG/WebP only; omit for PNG |
input_images | Up to 10 of your uploaded reference URLs for editing |
prompt_enhancement_enabled | Opt out of preliminary prompt enhancement |
count. All four models range from 1–18 tokens for one image across current presets; the base price does not cover every combination. SVG, GIF, markup, transparency, partial-image streaming, extra quality controls and tools are outside this phase. Editing uses whole-image references. The old gpt-image-2 remains in history and accepted jobs, and is removed from new selection.
A response can be queued / processing; poll GET /api/v2/generations/{id} until completion. Do not create a new paid request just to retrieve the same result again.
