Home → Blog → How to transcribe audio straight from the terminal
How to transcribe audio straight from the terminal
Sometimes writing a program is pointless: you have a dozen recordings to process and forget. The terminal handles that better than any application — one curl call turns a file into text, and a short script drains an entire folder.
A single file
curl https://voicesscribe.com/v1/audio/transcriptions \
-H "Authorization: Bearer $VS_KEY" \
-F file=@call.ogg \
-F model=whisper-1
The response is JSON. To get only the text, pipe it through jq:
curl -s https://voicesscribe.com/v1/audio/transcriptions \
-H "Authorization: Bearer $VS_KEY" \
-F file=@call.ogg -F model=whisper-1 | jq -r .text
Keep the key in an environment variable: commands with an inline key end up in shell history and in logs.
Other response formats
The response_format field selects the output right in the request:
# subtitles straight into a file
curl -s https://voicesscribe.com/v1/audio/transcriptions \
-H "Authorization: Bearer $VS_KEY" \
-F file=@lecture.ogg -F model=whisper-1 \
-F response_format=srt -o lecture.srt
# plain text with no JSON wrapper
curl -s https://voicesscribe.com/v1/audio/transcriptions \
-H "Authorization: Bearer $VS_KEY" \
-F file=@note.ogg -F model=whisper-1 \
-F response_format=textA whole folder in one script
#!/bin/bash
set -euo pipefail
for f in recordings/*.ogg; do
out="${f%.ogg}.txt"
[ -f "$out" ] && continue
echo "processing $f"
curl -s --fail-with-body https://voicesscribe.com/v1/audio/transcriptions \
-H "Authorization: Bearer $VS_KEY" \
-F file=@"$f" -F model=whisper-1 \
| jq -r .text > "$out"
done
The existing-file check makes the script resumable: an interrupted run picks up where it stopped and already-processed recordings are never paid for twice.
Troubleshooting
The --fail-with-body flag makes curl return a non-zero exit code and show the error body — without it the script silently writes the error text into your transcript file. Other useful tricks:
- Show only the status code: add -o /dev/null -w "%{http_code}\n".
- Inspect request and response headers: the -v flag.
- Check the real format before sending: ffprobe reports the actual codec, not the extension.
Try it on your own recordings. Sign-up takes a minute, and the free minutes are enough to judge the quality.
Get a free API keyFrequently asked questions
Is jq required?
No. Without it the file receives the whole JSON body. Alternatively request response_format=text and get clean text directly.
How do I keep the key out of shell history?
Store it in an environment variable or in a permission-restricted file that your shell sources.
The script stops at the first error — how do I continue?
Drop set -e or wrap the call in a status check, collecting failed files into a list for a second pass.
Does this work on Windows?
Yes, PowerShell ships curl.exe and the flags are identical. For scripts, WSL or Git Bash is more comfortable.
Related reading
- How to build a batch transcription pipeline for an audio archive — Transcribing thousands of recordings without losing any: a work queue, concurrency, retries, resuming after a crash and keeping the bill under control.
- Transcription API errors and what they actually mean — A walkthrough of transcription API status codes: why 401, 400, 413, 429 and 502 happen, how to fix each one and which failures are worth retrying.
- Which audio format to use for speech recognition — mp3, wav, ogg, opus, m4a and webm for speech recognition: what bitrate changes, why mono at 16 kHz is enough and how to stay under the size limit.