en_male_01, en_female_01
• set via JSON field voice_id.
Log in to the Dashboard → go to Account → API Keys → create or copy your key.
Open the Try-It page,
paste your x-api-key, enter text, then click Synthesize.
The audio player will auto-play your result.
Send a POST request to the TTS endpoint:
curl -X POST "https://tts.bryerstone.com/api/tts" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello from MLOS TTS!",
"voice_id": "en_male_01",
"output_format": "wav",
"return_base64": true
}'
curl -X POST "https://tts.bryerstone.com/api/tts" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "text":"Hello from MLOS TTS!", "voice_id":"en_female_01",
"prompt_length":1, "sampling_rate":16000,
"output_format":"wav", "return_base64": true }' \
-o output.wav
The response will include audio as base64 or raw binary (depending on your headers).
Swagger UI at /docs
lets you call the API interactively, but you must supply your x-api-key.
x-api-key.POST /api/tts, add a header manually:
x-api-key: YOUR_API_KEY
Once authorized, you can use Try it out → Execute to generate speech right in Swagger.
This guide shows how to send text to tts.bryerstone.com and receive audio output in different programming languages.
📚 View API Examples in Multiple Languages
import requests
API_URL = "https://tts.bryerstone.com/api/tts"
API_KEY = "YOUR_API_KEY"
payload = {
"text": "Hello world, this is Bryerstone TTS!",
"voice_id": "en_female_01", # or "en_male_01"
"prompt_length": 1,
"sampling_rate": 16000,
"output_format": "wav",
"return_base64": False
}
headers = {"x-api-key": API_KEY, "Content-Type": "application/json"}
resp = requests.post(API_URL, json=payload, headers=headers)
open("output.wav","wb").write(resp.content)
curl -X POST "https://tts.bryerstone.com/api/tts" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "text":"Hello from MLOS TTS!", "voice_id":"en_female_01",
"prompt_length":1, "sampling_rate":16000,
"output_format":"wav", "return_base64": true }' \
-o output.wav
headers = {"x-api-key": API_KEY, "Content-Type": "application/json"}
resp = requests.post(API_URL, json=payload, headers=headers)
resp.raise_for_status()
with open("output.wav", "wb") as f:
f.write(resp.content)
print("Saved audio to output.wav")
Note: x-api-key is required for /api/tts. Use Bearer <JWT> only for other /api/* routes (login, protected, etc.).
const fetch = require("node-fetch");
const fs = require("fs");
const API_URL = "https://tts.bryerstone.com/api/tts";
const API_KEY = "YOUR_API_KEY";
(async () => {
const res = await fetch(API_URL, {
method: "POST",
headers: {
"x-api-key": API_KEY,
"Content-Type": "application/json"
},
body: JSON.stringify({
text: "Hello world, this is Bryerstone TTS!",
voice_id: "en_male_01",
prompt_length: 1,
sampling_rate: 16000,
output_format: "wav",
return_base64: false
})
});
if (!res.ok) throw new Error("HTTP " + res.status + ": " + (await res.text()));
const buf = await res.buffer();
fs.writeFileSync("output.wav", buf);
console.log("Saved audio to output.wav");
})();
Note: x-api-key is required for /api/tts. Use Bearer <JWT> only for other /api/* routes (login, protected, etc.).
curl -X POST "https://tts.bryerstone.com/api/tts" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "text":"Hello world, this is Bryerstone TTS!","voice_id":"en_male_01",
"prompt_length":1, "sampling_rate":16000, "output_format":"wav", "return_base64": false }' \
-o output.wav
Note: x-api-key is required for /api/tts. Use Bearer <JWT> only for other /api/* routes (login, protected, etc.).
Replace YOUR_API_KEY for calls to /api/tts.
Use a JWT (from POST /api/login) only for other /api/* endpoints.
See /examples for more sample scripts.