AI-инструменты
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_bodyГенерация (результаты)
AI-инструменты
Upscale, Face Swap, Remove BG, Style Transfer, Colorize, InPaint, OCR — доступны на Starter
POST
/
api
/
v2
/
generate
AI-инструменты
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_bodyВсе AI-инструменты доступны на тарифе Starter (подписка не нужна). Стоимость: 1–3 токена.
Доступные инструменты
| Slug | Название | Токены | Описание |
|---|---|---|---|
upscale | Upscale ESRGAN | 1 | Увеличение изображения в 2×/4× |
face-swap | Face Swap | 1 | Замена лица между двумя изображениями |
remove-bg | Remove BG | 1 | Удаление фона с изображения |
style-transfer | Style Transfer | 1 | Перенос художественного стиля |
colorize | Colorize | 1 | Раскраска чёрно-белых фото |
inpaint | InPaint Edit | 3 | Редактирование выбранной области |
text-ocr | Text OCR | 1 | Извлечение текста из изображений |
Формат запроса
Инструменты используют тот же эндпоинтPOST /api/v2/generate. Передайте слаг инструмента в model, URL изображения в params:
curl -X POST https://elumenta.ru/api/v2/generate \
-H "Authorization: Bearer nb_ВАШ_КЛЮЧ" \
-H "Content-Type: application/json" \
-d '{
"model": "remove-bg",
"prompt": "remove background",
"params": {
"image_url": "https://example.com/photo.jpg"
}
}'
Примеры
import requests
# Удаление фона
res = requests.post(
"https://elumenta.ru/api/v2/generate",
headers={"Authorization": "Bearer nb_ВАШ_КЛЮЧ"},
json={
"model": "remove-bg",
"prompt": "remove background",
"params": {"image_url": "https://example.com/portrait.jpg"}
}
)
print(res.json()["result_url"])
# Апскейл 4x
res = requests.post(
"https://elumenta.ru/api/v2/generate",
headers={"Authorization": "Bearer nb_ВАШ_КЛЮЧ"},
json={
"model": "upscale",
"prompt": "upscale",
"params": {"image_url": "https://example.com/photo.jpg", "scale": 4}
}
)
print(res.json()["result_url"])
# OCR — извлечь текст
res = requests.post(
"https://elumenta.ru/api/v2/generate",
headers={"Authorization": "Bearer nb_ВАШ_КЛЮЧ"},
json={
"model": "text-ocr",
"prompt": "extract text",
"params": {"image_url": "https://example.com/document.jpg"}
}
)
print(res.json()["result_text"])
Ответ
{
"id": 18530,
"status": "completed",
"model_slug": "remove-bg",
"result_url": "https://storage.elumenta.ru/generations/18530.png",
"tokens_spent": 1,
"processing_ms": 2140
}
Все инструменты обрабатываются синхронно — опрос статуса не нужен, в ответе всегда
status: completed.⌘I

