Documentation Index Fetch the complete documentation index at: https://docs.elumenta.ru/llms.txt
Use this file to discover all available pages before exploring further.
Official Python SDK
The official Python SDK provides a clean interface for all Elumenta API endpoints.
Installation
Basic Usage
from elumenta import Elumenta
client = Elumenta( api_key = "nb_YOUR_API_KEY" )
# Text generation
response = client.text.generate(
model = "gpt-5" ,
messages = [{ "role" : "user" , "content" : "Explain blockchain in one paragraph" }]
)
print (response.content)
print ( f "Tokens used: { response.tokens_used } " )
# Image generation
image = client.image.generate(
model = "flux-1.1-pro" ,
prompt = "A serene Japanese garden in autumn" ,
size = "1024x1024" ,
format = "webp"
)
print ( f "Image URL: { image.url } " )
# Check balance
balance = client.user.balance()
print ( f "Remaining: { balance.token_balance } tokens" )
Streaming
for chunk in client.text.stream(
model = "claude-sonnet-4.5" ,
messages = [{ "role" : "user" , "content" : "Write a haiku about AI" }]
):
print (chunk.delta, end = "" , flush = True )
Video (with async polling)
import asyncio
from elumenta import AsyncElumenta
async def main ():
client = AsyncElumenta( api_key = "nb_YOUR_API_KEY" )
# Start generation
job = await client.video.generate(
model = "kling-v2.1" ,
prompt = "A sunset over the ocean, cinematic"
)
# Wait for completion
result = await job.wait( timeout = 300 )
print ( f "Video: { result.url } " )
asyncio.run(main())
JavaScript / TypeScript SDK
npm install @elumenta/sdk
import { Elumenta } from "@elumenta/sdk" ;
const client = new Elumenta ({ apiKey: "nb_YOUR_API_KEY" });
// Text generation
const response = await client . text . generate ({
model: "gpt-5" ,
messages: [{ role: "user" , content: "Hello!" }]
});
console . log ( response . content );
// Streaming
for await ( const chunk of client . text . stream ({
model: "claude-sonnet-4.5" ,
messages: [{ role: "user" , content: "Tell me a story" }]
})) {
process . stdout . write ( chunk . delta );
}
Raw HTTP Examples
No SDK? Use raw HTTP in any language.
package main
import (
" bytes "
" encoding/json "
" fmt "
" io "
" net/http "
)
func generateText ( apiKey , prompt string ) ( string , error ) {
payload := map [ string ] interface {}{
"model" : "gpt-5" ,
"messages" : [] map [ string ] string {
{ "role" : "user" , "content" : prompt },
},
}
body , _ := json . Marshal ( payload )
req , _ := http . NewRequest ( "POST" , "https://elumenta.ru/api/v2/generate" , bytes . NewBuffer ( body ))
req . Header . Set ( "Authorization" , "Bearer " + apiKey )
req . Header . Set ( "Content-Type" , "application/json" )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
return "" , err
}
defer resp . Body . Close ()
var result map [ string ] interface {}
json . NewDecoder ( resp . Body ). Decode ( & result )
return result [ "content" ].( string ), nil
}
func main () {
text , _ := generateText ( "nb_YOUR_API_KEY" , "Hello from Go!" )
fmt . Println ( text )
}
PHP
<? php
function generateImage ( string $apiKey , string $prompt ) : array {
$data = json_encode ([
'model' => 'dall-e-3' ,
'prompt' => $prompt ,
'size' => '1024x1024' ,
'format' => 'webp'
]);
$ch = curl_init ( 'https://elumenta.ru/api/v2/generate' );
curl_setopt_array ( $ch , [
CURLOPT_POST => true ,
CURLOPT_POSTFIELDS => $data ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey ,
'Content-Type: application/json'
]
]);
$response = curl_exec ( $ch );
curl_close ( $ch );
return json_decode ( $response , true );
}
$result = generateImage ( 'nb_YOUR_API_KEY' , 'A cat wearing a beret' );
echo $result [ 'url' ];
Postman Collection
Download our Postman collection to test all endpoints interactively:
Download Postman Collection Import into Postman and set your api_key environment variable.