Agent Voice gives AI agents the ability to create local speech recordings.
AI agents produce useful work, but they still communicate mostly through text. Every response competes for a developer's visual attention, so valuable work is often skimmed or missed.
My initial use case was listening alongside the text: text-to-speech for coding agents such as Codex and Claude Code.
The larger idea is simple: audio should be a first-class medium for agents.
Agent Voice runs locally, uses Kokoro-82M, and requires no API key. English is the best-supported language. The bundled 54-voice catalog also covers Japanese, Mandarin Chinese, Spanish, French, Hindi, Italian, and Brazilian Portuguese, though quality varies.
Install and setup
Install the CLI with uv:
uv tool install agent-voice
Or with pipx:
pipx install agent-voice
Then download the speech model:
agent-voice setup
For setup with terminal playback controls, see Terminal playback controls.
Test the CLI directly:
agent-voice speak "Hello from Agent Voice." -p
Choose a skill
Agent Voice provides two skill types:
create-speech-recordingturns supplied text into audio. Use it to create a recording or read something aloud.spoken-responsecreates the spoken semantic twin of an assistant response. It can speak the current response, the previous response, or later responses in the thread.
Choose the variant based on where you run your agent
| Where you use your agent | Recommended variant | What you get |
|---|---|---|
| ChatGPT (Codex), OpenCode Desktop, and Antigravity 2.0 | Use the -desktop skills |
Embedded native or HTML audio player |
| A terminal | Try -controls skills first |
Clickable agent-voice:// playback controls with a web-player fallback |
| Any other setup, or when desktop delivery or terminal controls do not work | Use the normal skills | Portable Markdown links to the web player, media app, and web audio |
Normal skills (most portable)
npx skills add yoav0gal/agent-voice -g --skill create-speech-recording
npx skills add yoav0gal/agent-voice -g --skill spoken-response
Desktop skills (best experience for desktop app users)
npx skills add yoav0gal/agent-voice -g --skill create-speech-recording-desktop
npx skills add yoav0gal/agent-voice -g --skill spoken-response-desktop
Controls skills (best experience in supported terminals)
agent-voice controls install
npx skills add yoav0gal/agent-voice -g --skill create-speech-recording-controls
npx skills add yoav0gal/agent-voice -g --skill spoken-response-controls
Remove the handler with agent-voice controls uninstall.
CLI
The CLI provides small primitives that agents can combine. Run
agent-voice COMMAND --help for the full options of any command.
| Command | What it does |
|---|---|
setup |
Download and verify speech model assets. |
update |
Upgrade Agent Voice through its uv or pipx installer. |
speak |
Turn text or stdin into a recording. |
play |
Play an existing local recording. |
voices |
List supported language tags and voices. |
models |
List speech models and variants. |
config |
View or change persistent defaults. |
doctor |
Check that Agent Voice is ready. |
service start|stop |
Manage the background speech service. |
viewer start|stop |
Manage the local recording viewer. |
controls install|uninstall |
Install or remove the agent-voice:// protocol handler. |
serve |
Start the localhost speech API. |
Speak
# Positional text
agent-voice speak "The build is finished."
# Agent output through stdin
printf '%s' "$TEXT" | agent-voice speak --label build-summary
# Use a file for a long spoken response
agent-voice speak --label response < "$RESPONSE_AS_TEXT_FILE"
# Choose the output and delivery
agent-voice speak "Here is your summary." \
--voice bf_emma --speed 1.2 --format mp3 -p
| Option | Purpose |
|---|---|
-o, --output PATH |
Write to an exact path. |
--label TEXT |
Set the managed filename prefix. |
--output-dir DIR |
Choose the managed output directory. |
-f, --format FORMAT |
Use wav, mp3, opus, or m4a. |
-v, --voice NAME |
Select a voice. |
--lang TAG |
Set the language tag (default: en-us). |
--speed NUMBER |
Set pitch-preserving playback speed. |
-p, --play |
Start local playback after creation, without waiting for it to finish. |
--play-after SECONDS |
Schedule local playback after creation, without waiting. |
--controls |
Include agent-voice:// playback control links. |
--wait |
Wait for the completed recording instead of returning live links. |
--no-service |
Run the same Agent Voice model inside this command, then unload it. |
--model-id ID, --variant NAME |
Select a model and build. |
speak prints one JSON receipt with the absolute recording path, generation
state, audio metadata, playback state (started or scheduled), and available
delivery links. By default it returns live links while generation continues;
pass --wait when the completed file is required before the command returns.
Speech text and the viewer transcript collapse whitespace, literal \n, \r,
and \t escapes, and HTML space entities to spaces. Paragraph breaks are
flattened. Write code and paths in their spoken form when needed; a lowercase
escape in a path such as C:\new is also treated as whitespace.
Configure defaults
# Show current defaults
agent-voice config
# Set your preferred voice, speed, format, service timeout, and output directory
agent-voice config --voice bf_emma --speed 1.15 --format mp3 \
--service-timeout 10 --output-dir ./recordings
# Restore built-in defaults
agent-voice config --reset
Voice, speed, format, and output directory can be overridden per recording with
speak.
For recordings generated on another machine, configure --viewer-base-url as
described below. --reset also restores localhost delivery links.
Manage the Agent Voice service
By default, speak starts the Agent Voice background service when needed. Once
the model weights are loaded, the service keeps them warm between requests to
avoid another cold startup. It stops after 10 idle minutes by default, and each
completed speech request restarts that timer. Automatic startup reuses a running
service without changing its timeout; service start uses the saved timeout or
an explicit --idle-timeout value.
agent-voice service start # stops after 10 idle minutes
agent-voice service start --idle-timeout 30 # set this process to 30 minutes
agent-voice service stop
Use agent-voice serve for a foreground service while debugging.
Discover and diagnose
agent-voice voices
agent-voice models
agent-voice doctor
agent-voice doctor --json
voices groups each installed voice under its supported --lang tag. Select a
pair with agent-voice speak --lang TAG --voice VOICE "Text".
Use --json with voices, models, config, or doctor when another tool or
agent will consume the result.
Play and view recordings
agent-voice play "/absolute/path/recording.mp3"
agent-voice play "/absolute/path/recording.mp3" --after 10
agent-voice viewer start
agent-voice viewer stop
The lightweight viewer starts automatically when needed and serves only local
recordings. It prefers http://127.0.0.1:8779 and selects a free port if that
port is unavailable. Each managed recording keeps an editable .txt source
beside it. At startup and every hour, the viewer removes temporary live-stream
audio older than one hour and owned recordings older than four days and 18
hours; files without Agent Voice source, transcript, and language metadata are
left alone. Opening a player or audio URL regenerates missing audio from its
source with the original language and current voice and speed.
Playback commands return as soon as local playback starts, or immediately with
scheduled when a delay is requested; they never wait for the recording to end.
Listen to recordings generated on another machine
Use Agent Voice 0.10.0 or newer. Run agent-voice update to upgrade an existing
installation. Run Agent Voice on the remote machine and expose its recording viewer through
a private HTTPS reverse proxy, such as Tailscale Serve. Configure one origin:
agent-voice config --viewer-base-url https://mini.your-tailnet.ts.net:8443
agent-voice viewer start --json
The viewer report includes its actual localhost port and its delivery_url.
Proxy that port, preserving the viewer's root paths. For example, if the report
says port 8779 and HTTPS port 8443 is unused:
tailscale serve --bg --https=8443 http://127.0.0.1:8779
agent-voice speak --label "Remote update" --wait "The remote recording is ready."
Use the returned delivery.browser_url as a Listen link in Codex, T3 Code, or
another chat. The browser plays on the device opening the link. Remote file
paths, agent-voice:// controls, and --play target the generating machine.
The skills use the browser link when generation is remote.
The configured origin must use HTTPS, with no credentials, path prefix, query,
or fragment. It controls returned player/audio/stream links and the exact Host
accepted for GET/HEAD requests. The viewer still binds to localhost. Speech
generation and local playback stay on localhost. The proxy must preserve the
original Host header or add X-Forwarded-For so proxied requests cannot start
playback on the host's speakers. Tailscale Serve meets this requirement.
Changes to this setting apply to the running
viewer without restarting it.
The setting applies to every recording on that machine, including local chats.
Serve restricts access to your tailnet; the viewer has no separate login. Anyone allowed to reach this route can read its recordings and narration text. Use a dedicated private Serve port, not a public Funnel route, and preserve existing routes. The setting does not configure Tailscale or verify remote access. Check the player link from your receiving device. If the viewer chooses a new port after a restart because its usual port is busy, update the proxy target.
Restore localhost delivery with:
agent-voice config --viewer-base-url default
Local speech API
agent-voice serve
curl http://127.0.0.1:8765/v1/audio/speech \
-H 'Content-Type: application/json' \
-d '{"input":"The task is complete.","voice":"af_heart","response_format":"mp3"}' \
--output speech.mp3
The API binds to localhost. speak uses it when available and falls back to
embedded inference.
Platform limitations
Prebuilt dependencies support macOS arm64/x64, Linux x64, and Windows x64. Linux arm64 requires a C build toolchain for miniaudio. On Windows arm64, use x64 Python under emulation.
Metadata
Release files for agent-voice 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agent_voice-0.10.0.tar.gz | 8.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agent_voice-0.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 MB
Release files / agent_voice-0.10.0.tar.gz
| Download URL | agent_voice-0.10.0.tar.gz |
|---|---|
| Size | 8.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1f72ab0a801ca14e8a6f3ad0abd0391f95c65e56a9f0d0a5f39f767915a7818
|
|
BLAKE2b-256 checksum How to use checksums |
ef363e241c79b45103ccc5dde481ba8e414a125c851818fcb3da98e108bc6a4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / agent_voice-0.10.0-py3-none-any.whl
| Download URL | agent_voice-0.10.0-py3-none-any.whl |
|---|---|
| Size | 428.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25244a83a80b5f6521ad0b485989a232580935603198d37d40a43e315da5c89f
|
|
BLAKE2b-256 checksum How to use checksums |
1e7fed65546b4f9cda0ce73b5fed72791ade66221d4a9f55b67df3ee304596e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency log