Back to Support

Custom API Setup

Connect Voice Reader to any TTS service with a compatible API

🔧 When to Use Custom API

Use Custom API when you want to connect to:

API Specification

Your TTS endpoint must accept HTTP POST requests and return audio data. Voice Reader supports two request formats:

Option 1: JSON Request Body

Request
POST /api/tts Content-Type: application/json Authorization: Bearer YOUR_API_KEY { "text": "Hello, world!", "voice": "en-US-JennyNeural", "rate": 1.0 }

Option 2: SSML Request Body

Request
POST /api/tts Content-Type: application/ssml+xml Authorization: Bearer YOUR_API_KEY <speak version="1.0" xml:lang="en-US"> <voice name="en-US-JennyNeural"> <prosody rate="1.0">Hello, world!</prosody> </voice> </speak>

Response Format

Your API must return audio data directly in the response body:

Response
HTTP/1.1 200 OK Content-Type: audio/mpeg [Binary audio data...]

Supported Audio Formats

Format Content-Type Notes
MP3 audio/mpeg Recommended, best compatibility
WAV audio/wav Larger file size
OGG audio/ogg Good compression
AAC audio/aac iOS native format

Request Parameters

Voice Reader sends these parameters in the JSON request body:

Parameter Type Description
text string The text to synthesize (required)
voice string Voice ID from your settings
rate number Speech rate (0.5 - 2.0, default 1.0)

Configure in Voice Reader

Open Voice Reader Settings and configure:

⚠️ Security Note

Your API key is stored securely on your device and is only sent to the URL you configure. Never share your API key with others.

Example: OpenAI-Compatible Server

Many self-hosted TTS solutions provide OpenAI-compatible APIs. Here's an example configuration:

Settings
Provider: Custom API API URL: http://localhost:8080/v1/audio/speech API Key: (leave empty for local) Voice ID: alloy

Troubleshooting

No audio playing

Authentication errors

Network errors

💡 Need Help?

If you're having trouble setting up a custom API, contact us with details about your TTS service and we'll help you configure it.