Transform text into natural-sounding speech with our enterprise-ready Voice Synthesis API. Perfect for developers, content creators, and businesses looking to add professional voice capabilities to their applications. Our API supports leading AI models from ElevenLabs and OpenAI, offering 30+ premium voices, multilingual support, and advanced customization options with enterprise-grade reliability.
The Voice Synthesis API allows developers to convert text into high-quality speech using state-of-the-art AI models. The API supports both ElevenLabs and OpenAI voice models, providing:
| Feature | ElevenLabs | OpenAI TTS |
|---|---|---|
| Voice Quality | High fidelity with emotion control | Professional studio quality |
| Language Support | 30+ languages | Primary focus on English |
| Generation Speed | Variable (Flash to Standard) | Consistently fast |
| Customization | Extensive voice settings | Basic voice selection |
| Cost Efficiency | Pay per character | Pay per character |
| Real-time Generation | Yes (with Flash models) | Yes |
| Voice Cloning | Available | Not available |
| Enterprise Support | Yes | Yes |
| Model | Description | Max Tokens | Provider |
|---|---|---|---|
| eleven_multilingual_v2 | Latest multilingual model with enhanced quality | 5000 | elevenlabs |
| eleven_multilingual_v1 | First generation multilingual model | 5000 | elevenlabs |
| eleven_monolingual_v1 | English-optimized model | 5000 | elevenlabs |
| eleven_turbo_v2 | Fast generation model | 5000 | elevenlabs |
| eleven_turbo_v2_5 | Enhanced turbo model | 5000 | elevenlabs |
| eleven_flash_v2 | Ultra-fast generation | 5000 | elevenlabs |
| eleven_flash_v2_5 | Latest ultra-fast model | 5000 | elevenlabs |
| Model | Description | Provider |
|---|---|---|
| tts-1-hd | High-definition voice models | openai |
| tts-1-1106 | Standard voice models | openai |
| Specification | Details |
|---|---|
| Audio Format | MP3, WAV |
| Sample Rate | 16kHz - 48kHz |
| Bit Depth | 16-bit, 24-bit |
| Channels | Mono, Stereo |
| Latency | 200ms - 2000ms |
| Max Input Length | 5000 tokens |
| Rate Limiting | Yes (configurable) |
::note{to="https://elevenlabs.io/voice-library">}
Browse more voices in the ElevenLabs Voice Library
::
curl -X POST 'https://apipie.ai/v1/audio/speech' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"model": "eleven_multilingual_v2",
"voice": "Rachel",
"input": "Hello! This is a test of the ElevenLabs text to speech API.",
"voice_settings": {
"stability": 0.5,
"similarity_boost": 0.75
}
}'
curl -X POST 'https://apipie.ai/v1/audio/speech' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"model": "tts-1-hd",
"voice": "shimmer",
"input": "Hello! This is a test of the OpenAI text to speech API."
}'
{
"created": 1729535643,
"audio": {
"content_type": "audio/mpeg",
"url": "https://example.com/generated-audio.mp3"
},
"usage": {
"text_characters": 57,
"cost": 0.004275,
"latency_ms": 1200
}
}
{
"created": 1729535643,
"audio": {
"content_type": "audio/mpeg",
"url": "https://example.com/generated-audio.mp3"
},
"usage": {
"text_characters": 52,
"cost": 0.0035,
"latency_ms": 800
}
}
Common errors and solutions:
{
"error": {
"code": "invalid_voice",
"message": "The specified voice is not available for this model."
}
}
Solution: Verify voice compatibility with chosen model.
{
"error": {
"code": "text_too_long",
"message": "Input text exceeds maximum length for selected model."
}
}
Solution: Break text into smaller segments.
RAG Tuning Guide: Enhance AI Responses
Discover RAG Tuning for AIโenhance responses with your data for accurate, cost-effective solutions without complex training. Try it today!
Configuration State Management
Learn how to manage application and user state with APIpie by Neuronic AI. Configure state via Inline CLI, API, or GUI. Includes examples, features, and best practices.