HomeBlog → How to transcribe audio straight from the terminal

How to transcribe audio straight from the terminal

Published 2026-08-20 · 4 min read

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=text

A 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:

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 key

Frequently 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