openreader/docs-site/docs/configure/tts-providers.md
Richard R 9da9232d39 feat: add support for Replicate TTS provider and models
- Updated environment variables documentation to include Replicate as a TTS provider option.
- Added Replicate to the sidebar for TTS provider guides.
- Included Replicate as a dependency in package.json and pnpm-lock.yaml.
- Enhanced audiobook chapter generation to normalize native speed settings based on the TTS provider.
- Improved error handling in TTS API routes to provide retry information for rate-limited responses.
- Updated AudiobookExportModal to reflect native speed support for Replicate models.
- Modified SettingsModal to set default model for Replicate.
- Enhanced SpeedControl component to conditionally render native speed controls based on provider support.
- Updated TTSContext to utilize effective native speed for TTS requests.
- Implemented Replicate request handling in the TTS generation logic.
- Added new documentation for configuring Replicate as a TTS provider.
2026-04-16 11:20:38 -06:00

2.5 KiB

title
TTS Providers

OpenReader routes all TTS requests through the Next.js server to an OpenAI-compatible API. You choose your provider and credentials in one of two places:

Environment variables: set in your .env or docker-compose.yml as server-level defaults. Applied when the user has no saved Settings.

Settings modal (Settings > TTS Provider): stored in the browser and sent with every TTS request. Overrides env vars.

:::note Set env vars as deployment-level defaults. Users (or you, in a single-user setup) can then change the provider, base URL, and API key from the Settings modal without redeploying. Clearing the Settings fields falls back to the env var defaults. :::

Providers

  • OpenAI: Cloud. Base URL pre-filled (https://api.openai.com/v1). API key required.
  • Replicate: Cloud. Base URL managed internally by OpenReader. API key required.
  • Deepinfra: Cloud. Base URL pre-filled (https://api.deepinfra.com/v1/openai). API key required.
  • Custom OpenAI-Like: Self-hosted or any custom endpoint. API_BASE must be set manually (typically ending in /v1). API key optional.

For OpenAI, Deepinfra, and Replicate you only need to supply an API key. For Custom OpenAI-Like you must also set API_BASE.

Built-in model catalogs

  • Replicate models: google/gemini-3.1-flash-tts, minimax/speech-2.8-turbo, qwen/qwen3-tts, inworld/tts-1.5-mini
  • OpenAI models: tts-1, tts-1-hd, gpt-4o-mini-tts
  • Deepinfra models: includes hexgrad/Kokoro-82M and additional hosted models (depending on API key / feature flags)

Custom provider requirements

Self-hosted or custom providers must expose OpenAI-compatible audio endpoints:

  • GET /v1/audio/voices
  • POST /v1/audio/speech

:::warning TTS requests are server-side TTS requests originate from the Next.js server, not the browser. API_BASE must be reachable from the server runtime. In Docker, use container names or host.docker.internal rather than localhost. :::

Provider guides