Text-to-Speech
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)
Text-to-Speech
Create speech files with GPT-Realtime 2.1 Mini and other catalog models
POST
/
api
/
v2
/
generate
Text-to-Speech
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_bodyGPT-Realtime 2.1 Mini
gpt-realtime-2.1-mini reads text into a complete audio file, including Russian speech.
Check account availability in the catalog.
Interactive voice sessions and user-facing streaming are planned for a later stage.
| Parameter | Value |
|---|---|
| Text | prompt, up to 4096 characters |
| Voice | params.voice: alloy, ash, ballad, coral, echo, sage, shimmer, verse, marin, cedar; default alloy |
| Speed | params.speed: 0.25–1.5; default 1 |
| Voice instructions | params.instructions, up to 500 characters |
| Format | params.response_format: mp3, opus, aac, flac, wav, pcm; default mp3 |
opus produces an Ogg/Opus file. pcm is raw signed 16-bit audio at 24 kHz, mono;
playback requires those parameters. MP3 and WAV are suitable for normal download and playback.
Price
| Inclusive text length | Platform tokens |
|---|---|
| 1–500 characters | 3 |
| 501–1500 | 8 |
| 1501–3000 | 15 |
| 3001–4096 | 20 |
prompt. There is no additional debit after generation.
Request a preliminary quote from POST /api/v2/models/gpt-realtime-2.1-mini/calculate-price,
passing the text as params.full_text with the selected controls.
Use the current quote for other TTS models.
Request
curl -X POST https://elumenta.ru/api/v2/generate \
-H "Authorization: Bearer nb_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-realtime-2.1-mini",
"prompt": "Welcome to Elumenta.",
"params": {
"voice": "alloy",
"speed": 1.0,
"instructions": "Read calmly and naturally.",
"response_format": "mp3"
}
}'
id, status and tokens_spent.
Poll GET /api/v2/generate/{id} until completed or failed.
Download the result from GET /api/v2/download/{id} with the same Authorization header.
If acknowledgement is lost, reconcile the existing job before submitting again; a new POST starts new work.
After catalog cutover, openai-tts, openai-tts-hd and gpt-4o-mini-tts are unavailable
for new selections. Historical results and prices remain. Legacy voices and speeds up to 4×
are not copied to the successor automatically.
For recognition, use the separate Speech-to-Text endpoint.
