curl https://www.samuraiapi.in/v1/audio/transcriptions \
-H "Authorization: Bearer $SAMURAI_API_KEY" \
-F model="whisper-1" \
-F file="@podcast.mp3" \
-F language="en" \
-F response_format="text"
with open("podcast.mp3", "rb") as f:
transcript = client.audio.transcriptions.create(
model="whisper-1",
file=f,
language="en",
response_format="text"
)
print(transcript)
with open("video.mp4", "rb") as f:
srt = client.audio.transcriptions.create(
model="whisper-1",
file=f,
response_format="srt"
)
with open("subtitles.srt", "w") as out:
out.write(srt)
{
"text": "Welcome to Samurai AI. Today we're going to talk about building AI-powered applications using our unified API gateway."
}
Welcome to Samurai AI. Today we're going to talk about building AI-powered applications using our unified API gateway.
1
00:00:00,000 --> 00:00:04,500
Welcome to Samurai AI.
2
00:00:04,500 --> 00:00:09,200
Today we're going to talk about building AI-powered applications.
Audio
Transcribe Audio
Transcribe audio files to text using Whisper. Supports 99 languages and subtitle export.
POST
/
audio
/
transcriptions
curl https://www.samuraiapi.in/v1/audio/transcriptions \
-H "Authorization: Bearer $SAMURAI_API_KEY" \
-F model="whisper-1" \
-F file="@podcast.mp3" \
-F language="en" \
-F response_format="text"
with open("podcast.mp3", "rb") as f:
transcript = client.audio.transcriptions.create(
model="whisper-1",
file=f,
language="en",
response_format="text"
)
print(transcript)
with open("video.mp4", "rb") as f:
srt = client.audio.transcriptions.create(
model="whisper-1",
file=f,
response_format="srt"
)
with open("subtitles.srt", "w") as out:
out.write(srt)
{
"text": "Welcome to Samurai AI. Today we're going to talk about building AI-powered applications using our unified API gateway."
}
Welcome to Samurai AI. Today we're going to talk about building AI-powered applications using our unified API gateway.
1
00:00:00,000 --> 00:00:04,500
Welcome to Samurai AI.
2
00:00:04,500 --> 00:00:09,200
Today we're going to talk about building AI-powered applications.
ISO-639-1 language code (e.g.
en, ja, fr, de, es). Providing this improves accuracy and speed.Output format. Options:
json, text, srt (subtitles), vtt (web subtitles), verbose_json.curl https://www.samuraiapi.in/v1/audio/transcriptions \
-H "Authorization: Bearer $SAMURAI_API_KEY" \
-F model="whisper-1" \
-F file="@podcast.mp3" \
-F language="en" \
-F response_format="text"
with open("podcast.mp3", "rb") as f:
transcript = client.audio.transcriptions.create(
model="whisper-1",
file=f,
language="en",
response_format="text"
)
print(transcript)
with open("video.mp4", "rb") as f:
srt = client.audio.transcriptions.create(
model="whisper-1",
file=f,
response_format="srt"
)
with open("subtitles.srt", "w") as out:
out.write(srt)
{
"text": "Welcome to Samurai AI. Today we're going to talk about building AI-powered applications using our unified API gateway."
}
Welcome to Samurai AI. Today we're going to talk about building AI-powered applications using our unified API gateway.
1
00:00:00,000 --> 00:00:04,500
Welcome to Samurai AI.
2
00:00:04,500 --> 00:00:09,200
Today we're going to talk about building AI-powered applications.