# Audio Transcriptions API — Speech to text Source: https://ofox.io/docs/api/openai/audio-transcriptions Turns audio into text. Compatible with OpenAI's `POST /v1/audio/transcriptions`; upload the audio file as `multipart/form-data`. | Family | Model | Notes | |---|---|---| | GPT transcription | `openai/gpt-transcribe`, `openai/gpt-4o-mini-transcribe`, `openai/gpt-4o-transcribe-diarize` | See [GPT transcription](https://ofox.io/docs/develop/models/gpt-transcribe) | | ElevenLabs | `elevenlabs/scribe_v2` | Supports word-level timestamps and speaker diarization; see [ElevenLabs](https://ofox.io/docs/develop/models/elevenlabs) | ## Quickstart - base_url: `https://api.ofox.io/v1` - Endpoint: `https://api.ofox.io/v1/audio/transcriptions` - Model ID: `openai/gpt-transcribe` **Python** ```python filename="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) ``` **cURL** ```bash filename="Terminal" curl https://api.ofox.io/v1/audio/transcriptions \ -H "Authorization: Bearer $OFOX_API_KEY" \ -F model=openai/gpt-transcribe \ -F language=zh \ -F prompt="以下是普通话的句子,请使用简体中文。" \ -F file=@meeting.mp3 ``` ## Request parameters **file** `file` · required The audio file, e.g. `mp3` or `wav`. A non-audio file returns 400. **model** `string` · required Model ID; see the table above. **language** `string` The language of the audio, e.g. `zh` or `en`. Detected automatically if omitted. **prompt** `string` 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_format** `string` · default `json` · values `json` / `verbose_json` Only `json` and `verbose_json` are supported; `text`, `srt` and `vtt` return 400. `verbose_json` applies only to ElevenLabs Scribe. **provider_options** `string` Provider-specific parameters, sent as a JSON string in a form field, e.g. `{"elevenlabs": {"diarize": true}}`. See each family page. ## Response ```json { "text": "今天天气很好,我们下午三点在会议室讨论新功能。", "usage": { "type": "duration", "seconds": 9 } } ``` **text** `string` The transcribed text. **usage** `object` 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](https://ofox.io/docs/develop/models/elevenlabs#scribe). If you need subtitle files, generate them yourself from the timestamps in `words`. ## Common errors | HTTP | Error message | Cause | Fix | |---|---|---|---| | 400 | `Unsupported response_format 'srt'. Only 'json' and 'verbose_json' are supported on this gateway` | `text`, `srt` or `vtt` was used | Use `json`; build subtitles from the timestamps | | 400 | `response_format 'verbose_json' is not compatible with model 'gpt-transcribe'. Use 'json' or 'text' instead.` | GPT transcription models do not support `verbose_json` | Use `json` | | 400 | `Unsupported file format txt` | The uploaded file is not audio | Upload audio such as `mp3` or `wav` | | 400 | `Model 'openai/gpt-5.4' is not supported on /v1/audio/transcriptions. Supported: ...` | The chosen model is not a transcription model | Use one of the models listed in the error | | 400 | `You must provide a model parameter.` | The request was sent as JSON rather than a form | Upload the file as `multipart/form-data` | For the full list of error codes, see [Error handling](https://ofox.io/docs/develop/guides/error-handling).