Speech-to-Text
curl --request POST \
--url https://api.example.com/api/v2/sttimport requests
url = "https://api.example.com/api/v2/stt"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v2/stt', 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/stt",
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/stt"
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/stt")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/stt")
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)
Speech-to-Text
Transcribe uploaded recordings with GPT-Transcribe and server-measured quotes
POST
/
api
/
v2
/
stt
Speech-to-Text
curl --request POST \
--url https://api.example.com/api/v2/sttimport requests
url = "https://api.example.com/api/v2/stt"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v2/stt', 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/stt",
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/stt"
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/stt")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/stt")
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-transcribe transcribes uploaded recordings. Use the dedicated multipart route
POST /api/v2/stt; an audio_url passed to /generate does not invoke this route.
GET /api/v2/models lists the STT models available to the account.
File and language
audio: a nonempty file up to 25 MiB (25 * 1024 * 1024bytes).- GPT-Transcribe formats: MP3, MPGA, MPEG, WAV, M4A, OGG, WEBM, MP4 and FLAC.
model:gpt-transcribe; if omitted, the server selects the currently available OpenAI STT model.language:autoor one two-letter code such asenorru.
Quote before execution
POST /api/v2/stt/quote takes the same audio, model and language fields.
It does not call the model or debit tokens. The response includes model,
duration_seconds, token_cost and an opaque quote_fingerprint.
Submit the quoted values as expected_token_cost and quote_fingerprint with the paid request.
If the file, model, controls or price changed, the server returns 409 before generation
and charging. Obtain a new quote and confirm it again; do not automatically replay the paid POST.
import requests
base = "https://elumenta.ru/api/v2"
headers = {"Authorization": "Bearer nb_YOUR_API_KEY"}
fields = {"model": "gpt-transcribe", "language": "en"}
with open("recording.mp3", "rb") as audio:
response = requests.post(
base + "/stt/quote", headers=headers,
files={"audio": ("recording.mp3", audio, "audio/mpeg")}, data=fields,
)
response.raise_for_status()
quote = response.json()
print("Price:", quote["token_cost"], "tokens")
# Continue only after accepting the displayed price.
with open("recording.mp3", "rb") as audio:
response = requests.post(
base + "/stt", headers=headers,
files={"audio": ("recording.mp3", audio, "audio/mpeg")},
data={**fields, "expected_token_cost": quote["token_cost"],
"quote_fingerprint": quote["quote_fingerprint"]},
)
response.raise_for_status()
print(response.json()["result_text"])
Response
{
"id": 18510,
"status": "completed",
"result_text": "Hello and welcome to today's episode.",
"tokens_spent": 1
}
id identifies the historical generation; the transcript is in result_text.
A direct request without quote fields remains valid: the server validates the file
and calculates the current price before execution. Use quoting for explicit price confirmation.
After catalog cutover, whisper and gpt-4o-transcribe are unavailable for new selections.
Historical identities, prices and results remain; an explicit retired-model request
is not silently redirected. Check other STT models against their current contracts;
passing an extra form field does not make it supported.
