Generation Status
curl --request GET \
--url https://api.example.com/api/v2/generate/{generation_id}import requests
url = "https://api.example.com/api/v2/generate/{generation_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v2/generate/{generation_id}', 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/{generation_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/{generation_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v2/generate/{generation_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/generate/{generation_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyGenerations (results)
Generation Status
Check the status of a pending async generation
GET
/
api
/
v2
/
generate
/
{generation_id}
Generation Status
curl --request GET \
--url https://api.example.com/api/v2/generate/{generation_id}import requests
url = "https://api.example.com/api/v2/generate/{generation_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v2/generate/{generation_id}', 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/{generation_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/{generation_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v2/generate/{generation_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/generate/{generation_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyPoll the status of an async generation. Video, music, and some image models process asynchronously — they return a generation ID immediately and you poll until complete.
Completed:
Failed (no tokens charged):
integer
required
The integer ID returned from
POST /api/v2/generate.Request
curl https://elumenta.ru/api/v2/generate/18502 \
-H "Authorization: Bearer nb_YOUR_API_KEY"
Responses
Pending:{
"id": 18502,
"status": "pending",
"model_slug": "kling-v2.1",
"result_url": null,
"tokens_spent": 0
}
{
"id": 18502,
"status": "completed",
"model_slug": "kling-v2.1",
"result_url": "https://storage.elumenta.ru/generations/18502.mp4",
"thumbnail_url": "https://storage.elumenta.ru/thumbnails/18502.jpg",
"tokens_spent": 44,
"processing_ms": 67420,
"result_metadata": { "duration": 5, "width": 1920, "height": 1080 }
}
{
"id": 18503,
"status": "failed",
"error": "Provider error: content policy violation",
"tokens_spent": 0
}
Polling Pattern
import requests, time
def wait_for_result(gen_id: int, api_key: str, interval: int = 5) -> dict:
headers = {"Authorization": f"Bearer {api_key}"}
while True:
res = requests.get(
f"https://elumenta.ru/api/v2/generate/{gen_id}",
headers=headers
).json()
if res["status"] in ("completed", "failed"):
return res
time.sleep(interval)
result = wait_for_result(18502, "nb_YOUR_API_KEY")
if result["status"] == "completed":
print(f"Ready: {result['result_url']}")
else:
print(f"Failed: {result['error']}")
Tokens are deducted only on
status: completed. If generation fails, your balance is not charged.Typical Wait Times
| Model | Expected wait |
|---|---|
luma-flash2 | 20–35s |
kling-v2.1 | 45–90s |
kling-v2.1-pro | 60–90s |
minimax-video | 60–90s |
luma-ray2 | 60–120s |
mj-video-480p | 60–120s |
mj-video-720p | 90–180s |
⌘I

