Skip to main content

Simple CLI wrapper for OpenAI Speech-to-Text API

Project description

openai-whisper-api-cli

Simple Python CLI wrapper for OpenAI Speech-to-Text.

Features

  • Transcribe local audio/video files with OpenAI Speech-to-Text
  • API key from --api-key or OPENAI_API_KEY
  • Print result to stdout (default)
  • Optionally write result to a file
  • Supports multiple response formats

Install (Recommended)

python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install openai-whisper-api-cli

Verify:

owhisper --version

Upgrade:

pipx upgrade openai-whisper-api-cli

Install From Source

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Authentication

Set env var:

export OPENAI_API_KEY="sk-..."

Or pass key directly:

owhisper transcribe ./audio.mp3 --api-key "sk-..."

--api-key takes precedence over OPENAI_API_KEY.

Usage

Print transcription to stdout:

owhisper transcribe ./audio.mp3

Write transcription to file:

owhisper transcribe ./audio.mp3 --output-file ./transcript.txt

Use custom model and response format:

owhisper transcribe ./audio.mp3 \
  --model gpt-4o-transcribe \
  --response-format json \
  --language en

Supported models

  • gpt-4o-transcribe
  • gpt-4o-mini-transcribe
  • gpt-4o-transcribe-diarize
  • whisper-1

Model list source:

CI and Publishing

GitHub Actions workflows:

  • .github/workflows/ci.yml: runs tests on push/PR
  • .github/workflows/publish.yml: builds and publishes to PyPI on tag push (v*)

PyPI trusted publishing setup

  1. Create your project on PyPI: openai-whisper-api-cli.
  2. In PyPI project settings, add a Trusted Publisher:
    • Owner: your GitHub org/user
    • Repository: openai-whisper-api-cli
    • Workflow: publish.yml
    • Environment: pypi
  3. In GitHub repo settings, ensure environment pypi exists (optional protection rules).

Release

python -m pytest
python -m build
python -m twine check dist/*
git tag v0.1.0
git push origin v0.1.0

Pushing the tag triggers automated publish.

Local manual publish (optional)

python -m build
python -m twine upload dist/*

License

MIT (see LICENSE).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openai_whisper_api_cli-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openai_whisper_api_cli-0.1.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file openai_whisper_api_cli-0.1.1.tar.gz.

File metadata

  • Download URL: openai_whisper_api_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openai_whisper_api_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2def269dfcdf87dd7fcd26090d938c97071abfc3f194e2b4ee4d4d22f686a575
MD5 05682f0886b5779cb1537cbad03f497f
BLAKE2b-256 0efc687bc0d04a54ce72dea64ecbcc038e33917174416c3d0b0beef7f79fcdb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for openai_whisper_api_cli-0.1.1.tar.gz:

Publisher: publish.yml on NmadeleiDev/openai-whisper-api-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openai_whisper_api_cli-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openai_whisper_api_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d460667a79adcf9574d5c43cc1d9d07b9ccc1b48132a1ceb89af09d0c29411ff
MD5 5473efa6bc50feacf3479ad2c6e3f303
BLAKE2b-256 31ead26684bc27c6b4ebfeef3696336f58992a7375bae10d6500ed7dd291122b

See more details on using hashes here.

Provenance

The following attestation bundles were made for openai_whisper_api_cli-0.1.1-py3-none-any.whl:

Publisher: publish.yml on NmadeleiDev/openai-whisper-api-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page