Transcription
Transcribe audio files
POST https://alprouter.com/api/v1/audio/transcriptions converts audio files into text. It can use the audio.transcriptions.create of OpenAI SDK directly. Unlike other addresses, it sends the files in multipart/form-data format, rather than JSON format.
from openai import OpenAI
client = OpenAI(
base_url="https://alprouter.com/api/v1",
api_key="alp-your-key",
)
with open("meeting.mp3", "rb") as audio:
result = client.audio.transcriptions.create(
model="openai/gpt-4o-mini-transcribe",
file=audio,
language="ko",
)
print(result.text)file: Please accept files in formats such as mp3, mp4, m4a, wav, webm, ogg, flac, up to a maximum of 25MB. Longer recordings should be sent in separate files.language: It’s more accurate and faster when using language codes likekoanden. If not written down, the information will be remembered by itself.prompt: It’s possible to provide a list of words that are easily misused, such as people’s names or technical terms.- If it’s
response_format:json(default), then bothtextandusagewill come together. If it’stext, then only the text that was typed will be displayed. - The cost is determined based on the length of the audio recording and the amount of text that is transcribed. One minute of audio corresponds to approximately 600 tokens. The cost of this request is displayed in dollars, and it’s listed under
usage.cost. - It doesn’t support the format of subtitles with time indication (srt, vtt), nor does it support real-time transcription.