Create 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>",
"params": {}
}
'import requests
url = "https://api.example.com/api/v2/generate"
payload = {
"model": "<string>",
"prompt": "<string>",
"params": {}
}
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>', params: {}})
};
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>',
'params' => [
]
]),
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 \"params\": {}\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 \"params\": {}\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 \"params\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"status": "<string>",
"model_slug": "<string>",
"result_text": {},
"result_url": {},
"thumbnail_url": {},
"error": {},
"tokens_spent": 123,
"processing_ms": 123,
"result_metadata": {}
}Generate
Create Generation
The single unified endpoint for all AI generation types
POST
/
api
/
v2
/
generate
Create 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>",
"params": {}
}
'import requests
url = "https://api.example.com/api/v2/generate"
payload = {
"model": "<string>",
"prompt": "<string>",
"params": {}
}
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>', params: {}})
};
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>',
'params' => [
]
]),
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 \"params\": {}\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 \"params\": {}\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 \"params\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"status": "<string>",
"model_slug": "<string>",
"result_text": {},
"result_url": {},
"thumbnail_url": {},
"error": {},
"tokens_spent": 123,
"processing_ms": 123,
"result_metadata": {}
}Overview
POST /api/v2/generate is the one endpoint for all AI generation — text, images, video, audio, TTS, music. The model slug determines what gets generated and what params are accepted.
string
required
Authorization: Bearer nb_YOUR_API_KEYstring
required
Model slug. See Model Catalog for all available slugs.
string
required
The prompt or input text. For text models: the user message. For image/video: the visual description.
object
default:"{}"
Model-specific parameters. Examples below by category.
Text Generation
{
"model": "claude-sonnet-4.5",
"prompt": "Write a product description for wireless headphones",
"params": {
"system_prompt": "You are a professional copywriter.",
"temperature": 0.7,
"max_tokens": 500,
"messages": [
{"role": "user", "content": "Previous message for multi-turn context"}
]
}
}
curl -X POST https://elumenta.ru/api/v2/generate \
-H "Authorization: Bearer nb_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4.5",
"prompt": "Write a product description for wireless headphones",
"params": {
"system_prompt": "You are a professional copywriter.",
"temperature": 0.7
}
}'
import requests
res = requests.post(
"https://elumenta.ru/api/v2/generate",
headers={"Authorization": "Bearer nb_YOUR_API_KEY"},
json={
"model": "claude-sonnet-4.5",
"prompt": "Write a product description for wireless headphones",
"params": {"system_prompt": "You are a professional copywriter.", "temperature": 0.7}
}
)
print(res.json()["result_text"])
Image Generation
{
"model": "flux-1.1-pro",
"prompt": "Portrait of a CEO in a modern office, professional photography",
"params": {
"negative_prompt": "blurry, watermark, text",
"size": "1024x1024",
"format": "webp",
"seed": 42
}
}
params:
| Param | Type | Description |
|---|---|---|
size | string | e.g. 1024x1024, 1024x1792, 768x1344 |
format | string | webp (default), png, jpeg |
quality | string | standard or hd (DALL-E 3, GPT Image) |
negative_prompt | string | What to exclude (Flux, SD models) |
seed | integer | For reproducible results |
aspect_ratio | string | e.g. 16:9, 9:16 (Midjourney) |
Video Generation
{
"model": "kling-v2.1-pro",
"prompt": "A drone flyover of a futuristic city at night, cinematic",
"params": {
"duration": 5,
"aspect_ratio": "16:9",
"image_url": "https://example.com/start-frame.jpg"
}
}
Video generations return
status: "pending". Poll GET /api/v2/generate/{id} for the result.TTS / Voice
{
"model": "elevenlabs-v2",
"prompt": "Welcome to Elumenta. Your AI-powered creative studio.",
"params": {
"voice_id": "rachel",
"speed": 1.0,
"format": "mp3"
}
}
Response
integer
Generation ID (integer). Use for polling:
GET /api/v2/generate/{id}string
completed | pending | failedstring
The model used.
string | null
Text output. Present for LLM, STT, and tool responses.
string | null
File URL. Present for image, video, audio, and TTS responses.
string | null
Thumbnail URL for video results.
string | null
Error message if
status is failed.integer
Elumenta tokens deducted. Zero if failed.
integer
Processing time in milliseconds.
object | null
Additional data:
width, height for images; duration for video/audio; etc.Response Example — Text
{
"id": 18473,
"status": "completed",
"model_slug": "claude-sonnet-4.5",
"result_text": "Introducing our Premium Wireless Headphones...",
"result_url": null,
"thumbnail_url": null,
"error": null,
"tokens_spent": 3,
"processing_ms": 2104,
"result_metadata": null
}
Response Example — Image
{
"id": 18491,
"status": "completed",
"model_slug": "flux-1.1-pro",
"result_text": null,
"result_url": "https://storage.elumenta.ru/generations/18491.webp",
"thumbnail_url": null,
"tokens_spent": 8,
"processing_ms": 6840,
"result_metadata": {
"width": 1024,
"height": 1024
}
}
Response Example — Pending (Video)
{
"id": 18502,
"status": "pending",
"model_slug": "kling-v2.1-pro",
"result_text": null,
"result_url": null,
"tokens_spent": 0,
"processing_ms": null,
"result_metadata": null
}
⌘I

