Easy-to-use text-to-speech with OpenAI's API. Handles long text automatically.
- Generate speech with OpenAI TTS models, voices, formats, and speed controls.
- Includes
gpt-4o-mini-ttsinstructions and reusable presets for tone and pacing. - Paste long scripts; the app chunks, generates, and joins audio automatically with ffmpeg.
- See live character count, chunk count, worker status, and estimated cost before running.
- Keep reproducible sidecar metadata and copy OpenAI request IDs for support.
- Store API keys through OS keyring, local fallback, or environment variables.
- CLI use available.
Download OpenAI-TTS-Setup.exe from the latest release and run it. ffmpeg is still required on PATH.
git clone https://github.com/sm18lr88/OpenAI_TTS_GUI.git
cd OpenAI_TTS_GUIWith uv (recommended):
uv sync
uv run python -m openai_tts_guiOr use the launch script:
# Windows
run_gui.bat
# macOS / Linux
./run_gui.shWith pip:
pip install .
python -m openai_tts_gui- Environment variable (highest priority): set
OPENAI_API_KEY - GUI: launch the app →
API Keymenu →Set/Update API Key...(stored in OS keyring) - Custom endpoint: set
OPENAI_BASE_URLfor self-hosted or compatible APIs
openai-tts --in input.txt --out output.mp3 --model tts-1 --voice alloy --format mp3 --speed 1.0
openai-tts --in input.txt --out output.wav --model gpt-4o-mini-tts --voice nova --format wav --speed 1.25 --instructions "speak warmly"
openai-tts --help
openai-tts --versionCLI options mirror the core TTS settings: --model, --voice, --format, --speed,
--instructions, and --retain-files are available in addition to --in and --out.
uv sync --extra dev # install with dev deps
uv run ruff check # lint
uv run ruff format --check # format check
uv run pytest # tests (uses .pytest_tmp for temp files)
uv run ty check # type checkuv run pyinstaller --noconfirm openai_tts.spec # .exe in dist/
"C:\Program Files (x86)\NSIS\makensis.exe" installer.nsi # Windows installer in dist/The app bundle is built first into dist/OpenAI-TTS/, and the NSIS step packages that directory as dist/OpenAI-TTS-Setup.exe.
src/openai_tts_gui/
config/ Settings (pure Python) + Qt theme
core/ Text chunking, audio concat, ffmpeg, sidecar metadata
tts/ TTS service (pure Python, no Qt dependency)
keystore/ API key storage (keyring + encrypted file)
presets/ Instruction preset persistence
gui/ PyQt6 UI (main window, dialogs, worker thread, layout)
errors.py Domain error hierarchy
cli.py CLI entry point
main.py GUI entry point
See ARCHITECTURE.md for module boundaries and conventions.
This project uses a custom attribution and honor-system commercial license. If you use this code, give credit to "OpenAI TTS GUI by Leo Riera / sm18lr88".
Non-commercial use is encouraged. If the project helps you, gifts of any amount are appreciated at paypal.me/LeoRiera.
Commercial use requires buying a USD $5 honor-system commercial license at paypal.me/LeoRiera. See LICENSE for the full terms.
Show appreciation at paypal.me/LeoRiera if this app helps you. The app does not verify PayPal donations, does not add DRM, and does not track support clicks.
Privacy and trust notes:
Text you submit for speech generation is sent to OpenAI or to the compatible
endpoint configured with OPENAI_BASE_URL. API keys are read from
OPENAI_API_KEY, OS keyring, or the local fallback file shown in the app data
directory. Presets, settings, logs, and sidecar metadata are stored locally under
the data path shown in Help -> About; delete those files to remove local app
data. Sidecar files may include request IDs to help with OpenAI support.
Release artifacts include checksum files and are built from the public release workflow. The Windows installer is prepared for standard-user installation and safe uninstall checks. The project tracks Windows App Certification Kit and Microsoft Store MSI/EXE readiness, but it does not claim certification until an actual Windows SDK/App Certification Kit or Store submission report passes.
- ffmpeg not found: ensure it's on PATH. The app checks on startup.
- API key issues: try setting
OPENAI_API_KEYenvironment variable directly. - Logs: check the log file path shown in
Help→About.
- Speed adjustments far from 1.0x may impact quality. Use
gpt-4o-mini-ttswith instructions like "speak slowly" for better results. - Instruction examples at openai.fm.
api_key.encis obfuscated, not encrypted. Prefer OS keyring or environment variables.