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.
string
required
Transcription model. Currently:
whisper-1.file
required
Audio file to transcribe. Supported:
mp3, mp4, mpeg, mpga, m4a, wav, webm. Max 25MB.string
ISO-639-1 language code (e.g.
en, ja, fr, de, es). Providing this improves accuracy and speed.string
Optional text to guide the model’s style or continue a previous segment.
string
default:"json"
Output format. Options:
json, text, srt (subtitles), vtt (web subtitles), verbose_json.number
default:"0"
Sampling temperature
0–1. 0 for deterministic output.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.