Convert text to natural speech with our TTS API. 300+ voices, 70+ languages, multiple audio formats. Free tier with generous limits.
Converting text to natural-sounding speech is one of the most in-demand features in modern applications. From accessibility tools and e-learning platforms to voice assistants and content creation workflows, text-to-speech (TTS) technology has become essential. This guide covers everything you need to know about the DevProToolkit Text-to-Speech API — a free, developer-friendly service that offers over 300 neural voices across 70+ languages.
Powered by the edge-tts engine, this API delivers remarkably human-like speech synthesis without the complexity or cost of building your own TTS pipeline. Whether you need a single audio clip or want to integrate speech synthesis into a production application serving thousands of users, this API has you covered.
Try the TTS API in your browser — no API key required for the playground.
Open TTS PlaygroundA text-to-speech API is a web service that accepts text input and returns an audio file containing a spoken rendition of that text. Modern TTS APIs use neural network models to produce speech that closely resembles a natural human voice, with proper intonation, pacing, and emphasis.
The DevProToolkit TTS API accepts a POST request with your text and preferred voice, and returns an MP3 audio file ready for playback, download, or further processing. It supports:
There are several TTS APIs on the market — Google Cloud TTS, Amazon Polly, Azure Cognitive Services, and ElevenLabs among them. Here is why the DevProToolkit TTS API is worth considering:
Three steps to your first synthesized audio:
curl -X POST "https://api.commandsector.in/api/tts/speak" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Hello! Welcome to the DevProToolkit text-to-speech API.", "voice": "en-US-ChristopherNeural"}' \
-o welcome.mp3
Play the resulting welcome.mp3 file and you will hear a natural male American English voice reading your text. The entire process takes under a second for short texts.
POST /api/tts/speak
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to convert to speech |
voice | string | No | Voice identifier (default: en-US-ChristopherNeural) |
rate | string | No | Speech rate adjustment, e.g., +20% or -10% (default: +0%) |
pitch | string | No | Pitch adjustment, e.g., +5Hz or -10Hz (default: +0Hz) |
Response: audio/mpeg binary data (MP3 file)
GET /api/tts/voices/{language_code}
Returns a JSON array of all available voices for the specified language. For example, /api/tts/voices/en returns all English voices across all regional variants.
curl "https://api.commandsector.in/api/tts/voices/en" \
-H "X-API-Key: YOUR_API_KEY"
Example response:
[
{
"name": "en-US-ChristopherNeural",
"gender": "Male",
"locale": "en-US",
"language": "English (United States)"
},
{
"name": "en-US-JennyNeural",
"gender": "Female",
"locale": "en-US",
"language": "English (United States)"
},
{
"name": "en-GB-RyanNeural",
"gender": "Male",
"locale": "en-GB",
"language": "English (United Kingdom)"
}
]
GET /api/tts/languages
Returns a JSON array of all supported language codes and their display names.
curl "https://api.commandsector.in/api/tts/languages" \
-H "X-API-Key: YOUR_API_KEY"
With over 300 voices available, picking the right one matters. Here are the most popular voices organized by language and use case:
| Voice ID | Gender | Accent | Best For |
|---|---|---|---|
en-US-ChristopherNeural | Male | American | Narration, tutorials, professional content |
en-US-JennyNeural | Female | American | Customer service, e-learning, assistants |
en-US-GuyNeural | Male | American | Casual content, podcasts, blogs |
en-US-AriaNeural | Female | American | General purpose, news reading |
en-GB-RyanNeural | Male | British | Formal content, documentaries |
en-GB-SoniaNeural | Female | British | Audiobooks, storytelling |
en-AU-WilliamNeural | Male | Australian | Regional content, travel apps |
en-IN-NeerjaNeural | Female | Indian | India-market applications |
| Voice ID | Language | Gender |
|---|---|---|
es-ES-AlvaroNeural | Spanish (Spain) | Male |
es-MX-DaliaNeural | Spanish (Mexico) | Female |
fr-FR-HenriNeural | French | Male |
de-DE-ConradNeural | German | Male |
ja-JP-KeitaNeural | Japanese | Male |
zh-CN-XiaoxiaoNeural | Chinese (Mandarin) | Female |
hi-IN-MadhurNeural | Hindi | Male |
ar-SA-HamedNeural | Arabic (Saudi) | Male |
pt-BR-AntonioNeural | Portuguese (Brazil) | Male |
ko-KR-InJoonNeural | Korean | Male |
Tip: Use the /api/tts/voices/{lang} endpoint to programmatically discover all voices for a language. This lets you build voice selector dropdowns in your UI that automatically stay up to date as new voices are added.
The API supports over 70 languages and regional variants. Here is a partial list of the most commonly used ones:
| Language | Code | Voices Available |
|---|---|---|
| English (US, UK, AU, IN, CA) | en | 20+ |
| Spanish (ES, MX, AR, CO) | es | 15+ |
| French (FR, CA) | fr | 10+ |
| German | de | 8+ |
| Chinese (Mandarin, Cantonese) | zh | 15+ |
| Japanese | ja | 6+ |
| Korean | ko | 4+ |
| Hindi | hi | 4+ |
| Arabic | ar | 8+ |
| Portuguese (BR, PT) | pt | 8+ |
| Italian | it | 4+ |
| Dutch | nl | 4+ |
| Russian | ru | 4+ |
| Turkish | tr | 4+ |
| Polish | pl | 4+ |
| Swedish | sv | 2+ |
| Thai | th | 2+ |
| Vietnamese | vi | 2+ |
For the complete list, call the /api/tts/languages endpoint or visit the TTS Playground to browse all options interactively.
curl -X POST "https://api.commandsector.in/api/tts/speak" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "The quick brown fox jumps over the lazy dog.", "voice": "en-US-ChristopherNeural"}' \
-o speech.mp3
curl -X POST "https://api.commandsector.in/api/tts/speak" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Good afternoon. This is an example of British English speech synthesis.", "voice": "en-GB-SoniaNeural"}' \
-o british.mp3
curl -X POST "https://api.commandsector.in/api/tts/speak" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Hola, bienvenido a nuestra plataforma de servicios.", "voice": "es-ES-AlvaroNeural", "rate": "-15%"}' \
-o spanish_slow.mp3
curl -X POST "https://api.commandsector.in/api/tts/speak" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "こんにちは、開発者ツールキットへようこそ。", "voice": "ja-JP-KeitaNeural"}' \
-o japanese.mp3
curl "https://api.commandsector.in/api/tts/voices/en" \
-H "X-API-Key: YOUR_API_KEY" | python3 -m json.tool
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.commandsector.in"
def text_to_speech(text, voice="en-US-ChristopherNeural", rate="+0%", output_file="output.mp3"):
"""Convert text to speech and save as MP3."""
response = requests.post(
f"{BASE_URL}/api/tts/speak",
json={
"text": text,
"voice": voice,
"rate": rate
},
headers={"X-API-Key": API_KEY}
)
if response.status_code == 200:
with open(output_file, "wb") as f:
f.write(response.content)
print(f"Audio saved to {output_file}")
return output_file
else:
print(f"Error: {response.status_code} - {response.text}")
return None
# Generate speech
text_to_speech(
"Welcome to our platform. This tutorial will guide you through the setup process.",
voice="en-US-JennyNeural",
output_file="welcome_tutorial.mp3"
)
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.commandsector.in"
def get_voices(language="en"):
"""Retrieve all available voices for a language."""
response = requests.get(
f"{BASE_URL}/api/tts/voices/{language}",
headers={"X-API-Key": API_KEY}
)
return response.json()
def get_languages():
"""Retrieve all supported languages."""
response = requests.get(
f"{BASE_URL}/api/tts/languages",
headers={"X-API-Key": API_KEY}
)
return response.json()
# List all English voices
voices = get_voices("en")
print(f"Found {len(voices)} English voices:\n")
for voice in voices:
print(f" {voice['name']:40s} {voice['gender']:8s} {voice['locale']}")
# List all supported languages
languages = get_languages()
print(f"\nSupported languages: {len(languages)}")
for lang in languages[:10]:
print(f" {lang}")
import requests
import os
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.commandsector.in"
def generate_audio_article(paragraphs, voice="en-US-ChristopherNeural", output_dir="audio"):
"""Convert a list of paragraphs into individual audio files."""
os.makedirs(output_dir, exist_ok=True)
for i, paragraph in enumerate(paragraphs):
if not paragraph.strip():
continue
response = requests.post(
f"{BASE_URL}/api/tts/speak",
json={"text": paragraph.strip(), "voice": voice},
headers={"X-API-Key": API_KEY}
)
if response.status_code == 200:
filepath = os.path.join(output_dir, f"section_{i+1:03d}.mp3")
with open(filepath, "wb") as f:
f.write(response.content)
print(f"Generated: {filepath}")
else:
print(f"Failed on paragraph {i+1}: {response.status_code}")
# Example usage
blog_post = [
"Welcome to today's article about building scalable web applications.",
"In the first section, we will discuss the importance of API design.",
"Next, we will cover database optimization techniques.",
"Finally, we will look at deployment strategies for high-traffic sites."
]
generate_audio_article(blog_post, voice="en-US-GuyNeural")
const fs = require('fs');
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://api.commandsector.in';
async function textToSpeech(text, voice = 'en-US-ChristopherNeural', outputFile = 'output.mp3') {
const response = await fetch(`${BASE_URL}/api/tts/speak`, {
method: 'POST',
headers: {
'X-API-Key': API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({ text, voice }),
});
if (!response.ok) {
throw new Error(`TTS API error: ${response.status}`);
}
const buffer = Buffer.from(await response.arrayBuffer());
fs.writeFileSync(outputFile, buffer);
console.log(`Audio saved to ${outputFile}`);
}
// Generate speech
textToSpeech(
'This is a test of the text-to-speech API from Node.js.',
'en-US-JennyNeural',
'test_speech.mp3'
);
const express = require('express');
const app = express();
app.use(express.json());
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://api.commandsector.in';
// Endpoint for your frontend to request speech synthesis
app.post('/api/speak', async (req, res) => {
const { text, voice = 'en-US-JennyNeural' } = req.body;
if (!text || text.length > 5000) {
return res.status(400).json({ error: 'Text is required and must be under 5000 characters' });
}
try {
const ttsResponse = await fetch(`${BASE_URL}/api/tts/speak`, {
method: 'POST',
headers: {
'X-API-Key': API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({ text, voice }),
});
if (!ttsResponse.ok) {
return res.status(502).json({ error: 'TTS service error' });
}
// Stream the audio response to the client
res.set('Content-Type', 'audio/mpeg');
const buffer = Buffer.from(await ttsResponse.arrayBuffer());
res.send(buffer);
} catch (err) {
res.status(500).json({ error: 'Internal server error' });
}
});
// Endpoint to get available voices
app.get('/api/voices/:lang', async (req, res) => {
const response = await fetch(`${BASE_URL}/api/tts/voices/${req.params.lang}`, {
headers: { 'X-API-Key': API_KEY },
});
const voices = await response.json();
res.json(voices);
});
app.listen(3000, () => console.log('Server running on port 3000'));
// Frontend code to play TTS audio in the browser
async function speakText(text, voice = 'en-US-JennyNeural') {
const response = await fetch('/api/speak', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text, voice }),
});
if (!response.ok) throw new Error('Speech synthesis failed');
const audioBlob = await response.blob();
const audioUrl = URL.createObjectURL(audioBlob);
const audio = new Audio(audioUrl);
audio.play();
// Clean up when done
audio.addEventListener('ended', () => URL.revokeObjectURL(audioUrl));
}
// Usage
document.getElementById('speak-btn').addEventListener('click', () => {
const text = document.getElementById('text-input').value;
speakText(text);
});
Speech Synthesis Markup Language (SSML) gives you fine-grained control over how the text is spoken. You can add pauses, change emphasis, spell out words, and more. Pass SSML as the text field in your request.
<speak>
Welcome to our service.
<break time="500ms"/>
Let me walk you through the features.
<break time="1s"/>
First, let us look at the dashboard.
</speak>
<speak>
This is <emphasis level="strong">extremely important</emphasis> information.
<prosody rate="slow" pitch="+2st">Please read this carefully.</prosody>
</speak>
<speak>
Your confirmation code is
<say-as interpret-as="characters">ABCD1234</say-as>.
</speak>
curl -X POST "https://api.commandsector.in/api/tts/speak" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Welcome! Your order XK42 has been confirmed. Thank you for your purchase. ",
"voice": "en-US-JennyNeural"
}' \
-o ssml_demo.mp3
The rate and pitch parameters let you adjust how fast and how high or low the voice sounds:
| Parameter | Format | Range | Example |
|---|---|---|---|
rate | Percentage | -50% to +100% | +20% (20% faster) |
pitch | Hertz offset | -50Hz to +50Hz | -10Hz (slightly lower) |
-30% — Slow, deliberate speech for accessibility or language learners-15% — Slightly slower for narration and tutorials+0% — Natural default speed+15% — Slightly faster for summaries or news reading+30% — Fast narration for experienced listeners# Python: Generate the same text at different speeds
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.commandsector.in"
text = "Understanding speech rate control helps you tailor the listening experience."
for rate in ["-30%", "+0%", "+30%"]:
resp = requests.post(f"{BASE_URL}/api/tts/speak", json={
"text": text,
"voice": "en-US-ChristopherNeural",
"rate": rate
}, headers={"X-API-Key": API_KEY})
filename = f"rate_{rate.replace('+', 'plus').replace('-', 'minus')}.mp3"
with open(filename, "wb") as f:
f.write(resp.content)
print(f"Generated {filename} at rate {rate}")
Add audio alternatives to your web content for visually impaired users. Generate audio versions of articles, documentation, or notifications and serve them alongside the text.
Automatically narrate course content, quizzes, and instructions. Use different voices for different characters in educational scenarios. Adjust speech rate for different learning levels.
Convert blog posts, newsletters, or research summaries into podcast-style audio. Generate daily briefings or news digests for audio consumption.
Generate dynamic voice prompts for interactive voice response systems. Update menu options, announcements, and on-hold messages programmatically without recording studio time.
Present vocabulary and phrases in native-speaker quality across 70+ languages. Use the rate control to offer slow and normal-speed versions of the same content.
Generate audio alerts and notifications for IoT devices, smart home systems, or workplace announcement systems. Synthesize real-time alerts from monitoring systems.
Convert manuscripts, short stories, or documentation into audio format. Use SSML for dramatic pauses, emphasis, and character differentiation.
| Plan | Requests / Day | Rate Limit | Price |
|---|---|---|---|
| Free | 100 | 10 / minute | $0 / month |
| Pro | 10,000 | 100 / minute | $9.99 / month |
| Enterprise | Unlimited | Custom | Contact us |
The free tier is perfect for prototyping, personal projects, and low-volume production use. Each request can contain a substantial amount of text, so 100 requests per day goes further than you might expect. Get your free API key here.
Yes. The free tier provides 100 requests per day with no credit card required. Sign up at /signup and start synthesizing speech immediately. No trial period or expiration date — the free tier is permanent.
The API returns MP3 audio (audio/mpeg), which is universally supported across all browsers, mobile devices, and desktop media players. MP3 offers an excellent balance of quality and file size.
The API supports long-form text input. While there is no strict character limit published, we recommend keeping individual requests under 5,000 characters for optimal performance. For longer content, split it into paragraphs and make multiple requests.
The voices are powered by the edge-tts neural engine, which produces remarkably natural speech with proper intonation, rhythm, and emphasis. They are comparable in quality to premium TTS services. Try them in the TTS Playground to hear for yourself.
Yes. Audio generated through our API can be used in commercial applications, products, and content. There are no royalty fees or licensing restrictions on the output audio files.
Yes. You can pass SSML markup in the text field to control pauses, emphasis, pronunciation, speed, and pitch at a granular level. See the SSML section above for detailed examples.
Edge-tts is a high-quality neural text-to-speech engine that powers the speech synthesis. It provides the same voice technology used in Microsoft Edge's read-aloud feature, delivering natural and expressive speech across hundreds of voices and dozens of languages.
Yes. Use GET /api/tts/voices/{language_code} to get all voices for a specific language, or GET /api/tts/languages to list all supported languages. This allows you to build dynamic voice selectors that automatically include new voices as they are added.
curl -X POST "https://api.commandsector.in/api/tts/synthesize" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Hello world", "voice": "en-US-JennyNeural"}' \
-o speech.mp3
import requests
response = requests.post("https://api.commandsector.in/api/tts/synthesize", json={
"text": "Hello, this is a test",
"voice": "en-US-JennyNeural",
"rate": "+0%"
}, headers={"X-API-Key": "YOUR_API_KEY"})
with open("speech.mp3", "wb") as f:
f.write(response.content)
Get a free API key with 100 requests/day. No credit card required.
Get Free API Key