Audio
Speech to Text
Transcribe audio files to text.
POST
/
api
/
v1
/
audio
/
stt
Speech to Text
curl --request POST \
--url https://api.example.com/api/v1/audio/stt \
--header 'Content-Type: application/json' \
--data '
{
"file": {},
"language": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/audio/stt"
payload = {
"file": {},
"language": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({file: {}, language: '<string>'})
};
fetch('https://api.example.com/api/v1/audio/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/v1/audio/stt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file' => [
],
'language' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/audio/stt"
payload := strings.NewReader("{\n \"file\": {},\n \"language\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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/v1/audio/stt")
.header("Content-Type", "application/json")
.body("{\n \"file\": {},\n \"language\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/audio/stt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"file\": {},\n \"language\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created": "<string>",
"text": "<string>",
"language": {},
"duration_seconds": {},
"usage": {
"cost_cents": 123
}
}Transcribe an audio file to text. Uses multipart form upload (not JSON). Maximum file size: 25 MB.
Authentication
Requires a Bearer token. See Authentication.Request Body (multipart/form-data)
Audio file to transcribe. Supported formats: MP3, MP4, MPEG, MPGA, M4A, WAV, WEBM.
Language hint (ISO 639-1 code, e.g.,
"en", "es", "fr"). If omitted, language is auto-detected.Request Examples
curl -X POST https://www.hitheo.ai/api/v1/audio/stt \
-H "Authorization: Bearer $THEO_API_KEY" \
-F "file=@recording.mp3" \
-F "language=en"
const file = new Blob([audioBytes], { type: "audio/mp3" });
const result = await theo.stt(file, "en");
console.log(result.text); // Transcribed text
console.log(result.language); // Detected language
console.log(result.duration_seconds); // Audio duration
Response
Unique transcription ID (prefixed
stt_).ISO 8601 timestamp.
The transcribed text.
Detected or specified language.
Duration of the audio file in seconds.
Example Response
{
"id": "stt_abc123",
"created": "2026-04-10T12:00:00Z",
"text": "Welcome to Theo. How can I help you today?",
"language": "en",
"duration_seconds": 3.2,
"usage": { "cost_cents": 0.01 }
}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | missing_file | file is required (multipart form upload) |
| 401 | invalid_api_key | Missing or invalid API key |
| 502 | stt_provider_error | Theo transcription engine returned an error — retry |
| 503 | stt_unavailable | STT is not configured on this instance |
Was this page helpful?
⌘I
Speech to Text
curl --request POST \
--url https://api.example.com/api/v1/audio/stt \
--header 'Content-Type: application/json' \
--data '
{
"file": {},
"language": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/audio/stt"
payload = {
"file": {},
"language": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({file: {}, language: '<string>'})
};
fetch('https://api.example.com/api/v1/audio/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/v1/audio/stt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file' => [
],
'language' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/audio/stt"
payload := strings.NewReader("{\n \"file\": {},\n \"language\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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/v1/audio/stt")
.header("Content-Type", "application/json")
.body("{\n \"file\": {},\n \"language\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/audio/stt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"file\": {},\n \"language\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created": "<string>",
"text": "<string>",
"language": {},
"duration_seconds": {},
"usage": {
"cost_cents": 123
}
}