Python Integration SEO Page
Text to Speech API Python Example
Use eidosSpeech from Python with a simple HTTP call. Great for backend automation, scripts, and content pipelines.
Python requests Example
import requests
url = "https://eidosspeech.xyz/api/v1/tts"
headers = {
"X-API-Key": "esk_your_key_here",
"Content-Type": "application/json",
}
payload = {
"text": "Hello from Python integration",
"voice": "en-US-JennyNeural",
"format": "mp3",
}
resp = requests.post(url, headers=headers, json=payload, timeout=30)
resp.raise_for_status()
with open("output.mp3", "wb") as f:
f.write(resp.content)
print("Saved output.mp3")
Production Tips (Python)
- - Handle 429 responses with retry logic
- - Log
X-RateLimit-*headers - - Reuse `requests.Session()` for throughput
- - Cache repeated texts when possible
Useful Endpoints
- -
/api/v1/ttsfor direct audio - -
/api/v1/tts/translatefor translation flow - -
/api/v1/tts/from-srtfor subtitle timeline - -
/api/v1/developer/sdkfor SDK catalog
FAQ
Can I run this on CPU-only servers?
Yes. The API is suitable for CPU-only deployment scenarios with conservative concurrency settings.
Do I need async Python to use the API?
No. Standard synchronous `requests` is enough to start. Async is optional for higher throughput.
Related: Indonesia TTS API page