~/ Документация API / Речь => Текст
POST/audio/transcriptions
Речь → текст (STT). Принимает аудио (base64), возвращает расшифровку.
https://api.aiadapter.ru/api/v1/audio/transcriptionsПараметры тела
modelstringrequiredМодель
STT-модель, напр. openai/gpt-4o-transcribe.
filestringrequiredАудио
Аудиоданные в base64 (или multipart-загрузка).
languagestringЯзык
ISO-код языка для повышения точности (опционально).
Пример
curl https://api.aiadapter.ru/api/v1/audio/transcriptions \
-H "Authorization: Bearer sk-aa-v1-..." \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4o-transcribe","file":"<base64-аудио>"}'import requests
r = requests.post(
"https://api.aiadapter.ru/api/v1/audio/transcriptions",
headers={"Authorization": "Bearer sk-aa-v1-..."},
json={
"model": "openai/gpt-4o-transcribe",
"file": "<base64-аудио>"
},
)
print(r.json())const res = await fetch("https://api.aiadapter.ru/api/v1/audio/transcriptions", {
method: "POST",
headers: {
"Authorization": "Bearer sk-aa-v1-...",
"Content-Type": "application/json",
},
body: JSON.stringify({"model":"openai/gpt-4o-transcribe","file":"<base64-аудио>"}),
});
console.log(await res.json());Ответ HTTP 200
{
"text": "привет мир",
"usage": {
"input_tokens": 5,
"seconds": 3,
"total_tokens": 5,
"cost_rub": 0.38
}
}