Text-to-Speech
Convert text to natural-sounding speech in multiple languages including Amharic, Somali, Tigrinya, Oromo, and English with authentic native voices.
Overview
Selam API provides OpenAI-compatible text-to-speech with native Ethiopian language support. Choose from 9 authentic voices across 5 languages, with flexible audio formats and speed control.
Multi-Language
Native support for Amharic, Somali, Tigrinya, Oromo, and English with authentic voices.
Multiple Formats
Support for MP3, WAV, Opus, AAC, and FLAC audio formats for any use case.
Speed Control
Adjust playback speed from 0.25x to 4.0x for different use cases.
Information
Available Voices
Choose from 9 authentic voices across 5 languages. All voices are optimized for natural-sounding speech.
Amharic (አማርኛ)
mekdesFemaleNative Amharic female voice
amehaMaleNative Amharic male voice
bettyFemaleNative Amharic female voice
Somali (Soomaali)
ubaxFemaleNative Somali female voice
muuseMaleNative Somali male voice
Tigrinya (ትግርኛ)
samiMaleNative Tigrinya male voice
Oromo (Afaan Oromoo)
ibsaaMaleNative Oromo male voice
English
ariaFemaleStandard English female voice
andrewMaleStandard English male voice
Warning
Quick Start
Generate speech from text using the /v1/audio/speech endpoint:
1import requests
2
3def generate_speech(text, voice="mekdes", api_key="your-api-key"):
4 url = "https://api.selamgpt.com/v1/audio/speech"
5 headers = {
6 "X-API-Key": api_key,
7 "Content-Type": "application/json"
8 }
9 data = {
10 "model": "tts-1",
11 "input": text,
12 "voice": voice,
13 "response_format": "mp3"
14 }
15
16 response = requests.post(url, headers=headers, json=data)
17
18 if response.status_code == 200:
19 with open("output.mp3", "wb") as f:
20 f.write(response.content)
21 print("Audio saved as output.mp3")
22 else:
23 print(f"Error: {response.status_code} - {response.text}")
24
25# Generate Amharic speech
26generate_speech("ሰላም! እንዴት ነህ?", "mekdes")Request Parameters
modelrequiredTTS model to use. Options: tts-1 or tts-1-hd
inputrequiredText to convert to speech. Maximum length varies by tier:
- Standard: 1,500 characters
- Enhanced: 5,000 characters
- Premium: 12,500 characters
voicerequiredVoice to use for speech generation. See Available Voices section above.
response_formatoptionalAudio format. Options: mp3, opus, aac, flac, wav
Default: mp3
speedoptionalPlayback speed multiplier. Range: 0.25 to 4.0
Default: 1.0
Audio Formats
Choose the right audio format for your use case:
mp3RecommendedBest for general use, storage, and streaming
Compressed, widely supported
opusBest for real-time applications and low latency
Highly compressed, optimized for speech
aacGood for mobile applications
Compressed, good quality
flacBest for archival and highest quality
Lossless compression
wavBest for audio processing and editing
Uncompressed, large file size
Rate Limits
TTS rate limits are based on your account tier:
| Tier | Requests/Minute | Audio Minutes/Day | Max Characters |
|---|---|---|---|
| FREE | 5 | 5 minutes | 1,500 |
| BETA | 15 | 15 minutes | 5,000 |
| PRO | 30 | 40 minutes | 12,500 |
Information
Best Practices
Text Preparation
- •Clean text of special characters and formatting before sending
- •Use proper UTF-8 encoding for Ethiopian scripts
- •Remove excessive punctuation that may affect pronunciation
Chunking Long Text
- •Split long texts into smaller chunks for better performance
- •Break at natural sentence boundaries
- •Stay within character limits for your tier
Caching
- •Cache generated audio for repeated content
- •Use content hashing to identify duplicate requests
- •Store audio files locally or in CDN for faster delivery
Error Handling
- •Implement retry logic with exponential backoff
- •Handle rate limit errors gracefully
- •Provide fallback options for failed requests
Related Resources
Was this page helpful?