Audio Transcriptions API
Turns audio into text. Compatible with OpenAI’s POST /v1/audio/transcriptions; upload the audio file as multipart/form-data.
Quickstart
https://api.ofox.io/v1https://api.ofox.io/v1/audio/transcriptionsopenai/gpt-transcribePython
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
The audio file, e.g. mp3 or wav. A non-audio file returns 400.
Model ID; see the table above.
The language of the audio, e.g. zh or en. Detected automatically if omitted.
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.
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 }
}The transcribed text.
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
For the full list of error codes, see Error handling.