Speech to text
Menu
Audio

Speech to text

Transcribe audio into text in the original language.

POST /v1/audio/transcriptions

Transcribes an audio file into text in the language that is spoken. The endpoint follows the OpenAI Audio API (audio.transcriptions) and accepts multipart/form-data, so the official OpenAI SDKs work unchanged with base_url set to https://rutoken.ai/v1. Typical models are whisper-1, gpt-4o-transcribe and gpt-4o-mini-transcribe.

To translate speech into English instead, use Audio translation.

Authentication

Send your key in the Authorization: Bearer sk-xxxx header.

Request body

Content type: multipart/form-data. All form fields are forwarded to the upstream model.

Parameter Type Required Description
file file Yes Audio file: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav or webm. OpenAI limits uploads to 25 MB.
model string Yes Model ID, e.g. whisper-1. If omitted, the request is routed as whisper-1.
language string No Input language as an ISO-639-1 code (en, zh, ru…). Improves accuracy and latency.
prompt string No Optional text to guide style or continue a previous segment. Should match the audio language.
response_format string No json (default), text, srt, verbose_json or vtt. gpt-4o-*-transcribe models support only json and text.
temperature number No Sampling temperature from 0 to 1. Default 0.
timestamp_granularities[] array No word and/or segment. Requires response_format=verbose_json.

Request example

cURL
curl https://rutoken.ai/v1/audio/transcriptions \
  -H "Authorization: Bearer $API_KEY" \
  -F file="@meeting.mp3" \
  -F model="whisper-1" \
  -F language="en" \
  -F response_format="json"
Python
from openai import OpenAI

client = OpenAI(base_url="https://rutoken.ai/v1", api_key="sk-xxxx")
with open("meeting.mp3", "rb") as audio:
    resp = client.audio.transcriptions.create(
        model="whisper-1",
        file=audio,
        language="en",
    )
print(resp.text)
Node.js
import fs from "node:fs";
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://rutoken.ai/v1", apiKey: "sk-xxxx" });
const resp = await client.audio.transcriptions.create({
  model: "whisper-1",
  file: fs.createReadStream("meeting.mp3"),
  language: "en",
});
console.log(resp.text);

Response

With response_format=json:

json
{
  "text": "Good morning everyone, let's start with the quarterly results."
}

With response_format=verbose_json the response also contains language, duration and segments (and words when timestamp_granularities[]=word):

json
{
  "task": "transcribe",
  "language": "english",
  "duration": 4.2,
  "text": "Good morning everyone, let's start with the quarterly results.",
  "segments": [
    { "id": 0, "start": 0.0, "end": 4.2, "text": "Good morning everyone, let's start with the quarterly results." }
  ]
}

text, srt and vtt return plain text instead of JSON.

Field Type Description
text string The transcribed text.
language string Detected language (verbose_json).
duration number Audio length in seconds (verbose_json).
segments array Timed segments (verbose_json).

See also: Text to speech, Errors.