Skip to content

Speech Transcriptions (POST /v1/audio/transcriptions) ​

Transcribes audio into text in the specified format with complete OpenAI API wire compatibility.


HTTP Request ​

http
POST /v1/audio/transcriptions
Authorization: Bearer sk-oneasr-...
Content-Type: multipart/form-data

Request Body (Multipart Form) ​

FieldTypeRequiredDescription
filebinaryYesThe audio file object (mp3, mp4, wav, m4a, ogg, webm, flac, etc.).
modelstringYesTarget engine/model name (e.g. faster-whisper, qwen, whisper-1).
languagestringNoISO-639-1 language code (e.g. en, zh, ja, de, ko).
promptstringNoOptional guide prompt to steer spelling or domain vocabulary.
response_formatstringNoOutput format: json (default), text, srt, verbose_json, vtt.
temperaturenumberNoSampling temperature (0.0 to 1.0, default: 0.0).
timestamp_granularitiesarrayNoGranularities for verbose_json: ["word"], ["segment"].

Code Examples ​

cURL ​

bash
curl -X POST http://localhost:8000/v1/audio/transcriptions \
  -H "Authorization: Bearer sk-oneasr-v1-xxx" \
  -F file="@podcast.mp3" \
  -F model="faster-whisper" \
  -F response_format="verbose_json"

Python (Official OpenAI SDK) ​

python
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="sk-oneasr-v1-xxx"
)

with open("speech.mp3", "rb") as f:
    result = client.audio.transcriptions.create(
        model="faster-whisper",
        file=f,
        response_format="verbose_json"
    )

print(result.text)

Response (verbose_json) ​

json
{
  "task": "transcribe",
  "language": "english",
  "duration": 5.24,
  "text": "Welcome to OneASR private voice gateway.",
  "segments": [
    {
      "id": 0,
      "seek": 0,
      "start": 0.0,
      "end": 5.2,
      "text": "Welcome to OneASR private voice gateway.",
      "tokens": [50364, 4843, 284, 1530, 50589],
      "temperature": 0.0,
      "avg_logprob": -0.12,
      "compression_ratio": 1.1,
      "no_speech_prob": 0.001
    }
  ]
}