Skip to Content
API referenceOpenAI CompatibleAudio Transcriptions

Audio Transcriptions API

Turns audio into text. Compatible with OpenAI’s POST /v1/audio/transcriptions; upload the audio file as multipart/form-data.

FamilyModelNotes
GPT transcriptionopenai/gpt-transcribe, openai/gpt-4o-mini-transcribe, openai/gpt-4o-transcribe-diarizeSee GPT transcription
ElevenLabselevenlabs/scribe_v2Supports word-level timestamps and speaker diarization; see ElevenLabs

Quickstart

base_urlhttps://api.ofox.io/v1
Endpointhttps://api.ofox.io/v1/audio/transcriptions
Model IDopenai/gpt-transcribe
transcribe.py
import os from openai import OpenAI client = OpenAI(base_url="https://api.ofox.io/v1", api_key=os.environ["OFOX_API_KEY"]) with open("meeting.mp3", "rb") as f: result = client.audio.transcriptions.create( model="openai/gpt-transcribe", file=f, language="zh", prompt="以下是普通话的句子,请使用简体中文。", ) print(result.text)

Request parameters

filerequiredfile

The audio file, e.g. mp3 or wav. A non-audio file returns 400.

modelrequiredstring

Model ID; see the table above.

languagestring

The language of the audio, e.g. zh or en. Detected automatically if omitted.

promptstring

Prompt text for guiding word choice or proper nouns; applies to GPT transcription models. When transcribing Mandarin, pass language: "zh" together with the prompt “以下是普通话的句子,请使用简体中文。” (“The following are sentences in Mandarin; please use Simplified Chinese.”), otherwise the output may come back in Traditional Chinese characters.

response_formatstring· default json· valuesjsonverbose_json

Only json and verbose_json are supported; text, srt and vtt return 400. verbose_json applies only to ElevenLabs Scribe.

Provider-specific parameters, sent as a JSON string in a form field, e.g. {"elevenlabs": {"diarize": true}}. See each family page.

Response

{ "text": "今天天气很好,我们下午三点在会议室讨论新功能。", "usage": { "type": "duration", "seconds": 9 } }
textstring

The transcribed text.

usageobject

The billing basis. When type is duration, billing is by audio seconds (seconds); when it is tokens, billing is by tokens (input_tokens, output_tokens).

ElevenLabs Scribe also returns words (per-word text with start and end times), language, duration and other fields; see ElevenLabs. If you need subtitle files, generate them yourself from the timestamps in words.

Common errors

HTTPError messageCauseFix
400Unsupported response_format 'srt'. Only 'json' and 'verbose_json' are supported on this gatewaytext, srt or vtt was usedUse json; build subtitles from the timestamps
400response_format 'verbose_json' is not compatible with model 'gpt-transcribe'. Use 'json' or 'text' instead.GPT transcription models do not support verbose_jsonUse json
400Unsupported file format txtThe uploaded file is not audioUpload audio such as mp3 or wav
400Model 'openai/gpt-5.4' is not supported on /v1/audio/transcriptions. Supported: ...The chosen model is not a transcription modelUse one of the models listed in the error
400You must provide a model parameter.The request was sent as JSON rather than a formUpload the file as multipart/form-data

For the full list of error codes, see Error handling.

Last updated on