Skip to main content

OpenVoiceOS TTS Server

PyPI Python License: Apache 2.0

Turn any OVOS TTS plugin into a microservice — a small, stateless FastAPI app that exposes text-to-speech over HTTP.

  • 🔌 Plugin-agnostic — serve Piper, Coqui, Azure, or any OVOS TTS plugin behind one consistent HTTP API.
  • 🧩 Drop-in cloud-API compatibility — speak the ElevenLabs, OpenAI, Coqui, Google, Amazon Polly, Azure, MaryTTS, Cartesia, Deepgram Aura, and PlayHT APIs so existing clients and SDKs work unmodified (see API compatibility).
  • 🪶 Stateless & tiny — each request loads nothing extra; ideal for containers and horizontal scaling.
  • 🎛️ Format conversion — return WAV out of the box, or mp3/ogg/flac/… with the optional [audio] extra.

Install

pip install ovos-tts-server

# Optional: enable non-WAV output (mp3, ogg, flac, …) via pydub
pip install "ovos-tts-server[audio]"

You also need at least one TTS plugin, e.g. Piper:

pip install ovos-tts-plugin-piper

Quickstart

# Start the server with the Piper plugin
ovos-tts-server --engine ovos-tts-plugin-piper

# Synthesize over HTTP
curl "http://localhost:9666/v2/synthesize?utterance=hello%20world" -o hello.wav

Command line

ovos-tts-server [-h] [--engine ENGINE] [--port PORT] [--host HOST] [--cache] [--lang LANG]
Option Default Description
--engine ENGINE — TTS plugin to load (e.g. ovos-tts-plugin-piper)
--port PORT 9666 Port to bind
--host HOST 0.0.0.0 Host/interface to bind
--cache off Persist every synth to disk (cache across requests)
--lang LANG en-us Default language reported by the plugin

Configuration

The plugin is configured exactly as it would be inside the assistant — through mycroft.conf:

{
  "tts": {
    "module": "ovos-tts-plugin-piper",
    "ovos-tts-plugin-piper": {
      "model": "alan-low"
    }
  }
}

See docs/configuration.md for how voice and language flow from a request to the plugin.

HTTP API

The native OVOS endpoints:

Method Path Description
GET /status Plugin name, supported languages, default voice/model
GET /v2/synthesize?utterance=<text>[&lang=…][&voice=…] Primary synthesis endpoint — returns a WAV file
GET /synthesize/<utterance> Legacy path-based synthesis endpoint

Any extra query parameters on the synthesis endpoints are forwarded to the plugin as synthesis options. CORS is enabled for all origins.

curl http://localhost:9666/status
# {"status": "ok", "plugin": "ovos-tts-plugin-piper", "langs": ["en-us"], ...}

Third-party API compatibility

The server can additionally expose the same plugin behind drop-in compatibility endpoints for popular cloud TTS APIs. Each vendor lives under its own URL prefix, so every compat layer is active at once with no path collisions. Auth tokens / API keys are accepted and silently ignored — put real auth in a reverse proxy if you need it.

Vendor Prefix Key endpoint
ElevenLabs /elevenlabs POST /v1/text-to-speech/{voice_id}
OpenAI /openai POST /v1/audio/speech
Coqui /coqui GET /api/tts
Google Cloud TTS /google-tts POST /v1/text:synthesize
Amazon Polly /amazon-polly POST /v1/speech
Azure TTS /azure-tts POST /cognitiveservices/v1
MaryTTS /marytts GET/POST /process (+ root aliases)
Cartesia /cartesia POST /tts/bytes
Deepgram Aura /deepgram POST /v1/speak?model=…
PlayHT /playht POST /api/v2/tts/stream (+ pyht SDK auth)

Kokoro / kokoro-fastapi clients are OpenAI-compatible and need no dedicated prefix — point them at /openai/v1/audio/speech.

Most official SDKs accept a custom base URL; point them at http://<host>:9666/<prefix> and they work unmodified. See docs/api-compatibility.md for per-vendor endpoints, parameters, SDK snippets, and curl examples.

Python API

from ovos_tts_server import start_tts_server

app, engine = start_tts_server("ovos-tts-plugin-piper", cache=False)
# `app` is a FastAPI instance — mount it, test it, or run it with uvicorn

create_app(tts_engine) is also available if you want to build and inject the TTSEngineWrapper yourself.

Docker

Build a small image that serves any plugin:

FROM python:3.11-slim

RUN pip install --no-cache-dir "ovos-tts-server[audio]" {PLUGIN_HERE}

ENTRYPOINT ["ovos-tts-server", "--engine", "{PLUGIN_HERE}", "--cache"]
docker build . -t my_ovos_tts_plugin
docker run -p 8080:9666 my_ovos_tts_plugin
curl "http://localhost:8080/v2/synthesize?utterance=hello" -o hello.wav

Each plugin can ship its own Dockerfile in its repository using ovos-tts-server.

Companion plugin

Consume this server from a voice assistant via the companion TTS plugin.

Development

pip install -e ".[audio,test]"
pytest test/ -v

Documentation


Agent Integration

UTCP — Universal Tool Calling Protocol

The server exposes a UTCP manual at GET /utcp. Any UTCP-aware agent (e.g. ovos-tool-adapters UTCPToolBox) can point at this URL and auto-discover every synthesis endpoint without additional configuration.

No extra dependencies are needed — GET /utcp is always available.

Example response (abbreviated):

{
  "utcp_version": "1.0.1",
  "manual_version": "1.0.0",
  "tools": [
    {
      "name": "tts_synthesize_v2",
      "description": "Synthesize speech from text (OVOS v2 endpoint)...",
      "inputs": {
        "type": "object",
        "properties": {
          "utterance": {"type": "string"},
          "voice":     {"type": "string"},
          "lang":      {"type": "string"}
        },
        "required": ["utterance"]
      },
      "tool_call_template": {
        "call_template_type": "http",
        "url": "http://localhost:9666/v2/synthesize",
        "http_method": "GET"
      }
    }
  ]
}

ovos-tool-adapters config example:

{
  "utcp_config": {
    "providers": [
      {
        "provider_type": "http",
        "name": "ovos-tts",
        "url": "http://localhost:9666/utcp"
      }
    ]
  }
}

MCP — Model Context Protocol

The server can optionally expose a FastMCP server mounted at /mcp, providing a synthesize tool callable by any MCP-compatible agent (Claude Desktop, Claude Code, etc.).

Install the extra:

pip install "ovos-tts-server[mcp]"

Start with MCP enabled:

ovos-tts-server --engine ovos-tts-plugin-piper --mcp

Or from Python:

from ovos_tts_server import start_tts_server
app, engine = start_tts_server("ovos-tts-plugin-piper", enable_mcp=True)

The MCP server uses streamable HTTP transport (SSE-compatible) and is mounted alongside the existing FastAPI app — no separate process needed.

Claude Desktop claude_desktop_config.json example:

{
  "mcpServers": {
    "ovos-tts": {
      "transport": "http",
      "url": "http://localhost:9666/mcp"
    }
  }
}

synthesize tool:

Parameter Type Required Description
text string yes Text to synthesize
voice string no Voice/speaker identifier
lang string no BCP-47 language code (e.g. en-us)

Returns a JSON object:

{
  "mime_type": "audio/wav",
  "data": "<base64-encoded WAV>",
  "path": "/tmp/ovos_synth_abc123.wav",
  "phonemes": null
}

Credits

Developed by TigreGótico for OpenVoiceOS.

NGI0 Commons Fund

This project was funded through the NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101135429.

Metadata

Release files for ovos-tts-server 1.13.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ovos-tts-server 1.13.4
File Size Uploaded
ovos_tts_server-1.13.4.tar.gz 33.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ovos-tts-server 1.13.4
File Interpreter ABI Platform
ovos_tts_server-1.13.4-py3-none-any.whl Python 3 none any Details

Total release size: 73.4 kB

Release files / ovos_tts_server-1.13.4.tar.gz

Download URL ovos_tts_server-1.13.4.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f7d41dc357eaf3c1ce49c95f71ad3341312e6ac487f2f7f120faaffa5a2ea2af
BLAKE2b-256 checksum
How to use checksums
93422dac425ea4d41bf439d745f7013aaa7fca26b394bed51d55fab107101477
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / ovos_tts_server-1.13.4-py3-none-any.whl

Download URL ovos_tts_server-1.13.4-py3-none-any.whl
Size 39.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb5c51b6e2ea5d7e0bae1aa30e8be6f73480fbecd3b7074c87c156c58b3c905b
BLAKE2b-256 checksum
How to use checksums
4e81d90bf5efb9dbbd5de13c0c9ab6944fa61111b042bbe355c3299c47fd9744
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.13.4 This release

2 release files

1.13.2

2 release files

0.1.3

2 release files

0.1.0

2 release files

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page