Speech-to-text
curl --request POST \
--url https://api.infery.ai/v1/audio/transcriptions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"audio": "<string>",
"language": "<string>",
"response_format": "json"
}
'import requests
url = "https://api.infery.ai/v1/audio/transcriptions"
payload = {
"model": "<string>",
"audio": "<string>",
"language": "<string>",
"response_format": "json"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
audio: '<string>',
language: '<string>',
response_format: 'json'
})
};
fetch('https://api.infery.ai/v1/audio/transcriptions', 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.infery.ai/v1/audio/transcriptions",
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([
'model' => '<string>',
'audio' => '<string>',
'language' => '<string>',
'response_format' => 'json'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.infery.ai/v1/audio/transcriptions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"audio\": \"<string>\",\n \"language\": \"<string>\",\n \"response_format\": \"json\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.infery.ai/v1/audio/transcriptions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"audio\": \"<string>\",\n \"language\": \"<string>\",\n \"response_format\": \"json\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infery.ai/v1/audio/transcriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"audio\": \"<string>\",\n \"language\": \"<string>\",\n \"response_format\": \"json\"\n}"
response = http.request(request)
puts response.read_body{
"text": "Hello, this is a test transcription.",
"language": "en",
"duration": 12.5,
"segments": [
{
"id": 123,
"start": 123,
"end": 123,
"text": "<string>",
"avg_logprob": 123,
"compression_ratio": 123,
"no_speech_prob": 123
}
],
"credits_used": 3
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model"
}
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model"
}
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model"
}
}Audio
Speech-to-text
POST /v1/audio/transcriptions — transcribe audio to text.
POST
/
v1
/
audio
/
transcriptions
Speech-to-text
curl --request POST \
--url https://api.infery.ai/v1/audio/transcriptions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"audio": "<string>",
"language": "<string>",
"response_format": "json"
}
'import requests
url = "https://api.infery.ai/v1/audio/transcriptions"
payload = {
"model": "<string>",
"audio": "<string>",
"language": "<string>",
"response_format": "json"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
audio: '<string>',
language: '<string>',
response_format: 'json'
})
};
fetch('https://api.infery.ai/v1/audio/transcriptions', 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.infery.ai/v1/audio/transcriptions",
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([
'model' => '<string>',
'audio' => '<string>',
'language' => '<string>',
'response_format' => 'json'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.infery.ai/v1/audio/transcriptions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"audio\": \"<string>\",\n \"language\": \"<string>\",\n \"response_format\": \"json\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.infery.ai/v1/audio/transcriptions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"audio\": \"<string>\",\n \"language\": \"<string>\",\n \"response_format\": \"json\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infery.ai/v1/audio/transcriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"audio\": \"<string>\",\n \"language\": \"<string>\",\n \"response_format\": \"json\"\n}"
response = http.request(request)
puts response.read_body{
"text": "Hello, this is a test transcription.",
"language": "en",
"duration": 12.5,
"segments": [
{
"id": 123,
"start": 123,
"end": 123,
"text": "<string>",
"avg_logprob": 123,
"compression_ratio": 123,
"no_speech_prob": 123
}
],
"credits_used": 3
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model"
}
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model"
}
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model"
}
}We accept both multipart and JSON base64 for STT, so the OpenAI SDK works out of the box.
Multipart (OpenAI SDK default)
from openai import OpenAI
client = OpenAI(api_key=API_KEY, base_url="https://api.infery.ai/v1")
tr = client.audio.transcriptions.create(
model="whisper-1",
file=open("meeting.mp3", "rb"),
response_format="verbose_json",
)
print(tr.text)
JSON base64 (light HTTP clients)
curl https://api.infery.ai/v1/audio/transcriptions \
-H "Authorization: Bearer $INFERY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "whisper-1",
"file_base64": "<base64 audio>",
"filename": "meeting.mp3",
"response_format": "json"
}'
Response formats
json (default), text, srt, verbose_json (with segments + word timestamps), vtt.
Limits
- Max 25 MB audio per request
- Formats: MP3, MP4, M4A, WAV, WebM, OGG, FLAC
Authorizations
API key in format: Bearer inf_***
Body
application/json
Response
Transcription result. Shape depends on response_format: JSON (json, verbose_json) or plain text (text, srt, vtt).
response_format: json (default) or verbose_json
Example:
"Hello, this is a test transcription."
Detected language (verbose_json only)
Example:
"en"
Audio duration in seconds (verbose_json only)
Example:
12.5
Time-stamped segments (verbose_json only)
Show child attributes
Show child attributes
Example:
3
⌘I

