IVR Prompt Pack with Sonus
Convert a CSV of IVR prompts into telephony-ready WAV audio with POST https://api.sagea.space/v1/batch.
- Load prompts from CSV and validate length
- Batch synthesize to
wav16kHz mono - Write a filename manifest for your IVR system
Time to complete: ~20 minutes
Prerequisites
- Python 3.9+ with
pip install requests. ffmpegandffprobefor sample-rate checks.- A SAGEA API key exported as
SAGEA_API_KEY. - Read Synthesize speech with Sonus for voices and formats.
- Skim the Sonus TTS model card for rate limits and pricing.
Step 1: Prepare the prompt CSV
Create prompts.csv with id and text columns. Keep every row under 4096 chars.
Example rows are welcome, menu, hours, and fallback. Use professional emotion for phone audio.
Step 2: Batch synthesize to WAV
Send all prompts in one POST https://api.sagea.space/v1/batch call with endpoint set to /v1/audio/speech. Batch gets a 50 percent discount.
If batch is async, poll the returned batch_id until status is completed.
Step 3: Normalize to 16kHz mono and write a manifest
IVR systems expect WAV 16kHz mono. Convert and emit manifest.csv:
Limits are 50 req per min on Starter and 500 on Pro, so batch is preferred.
Verify
Every ivr_*.wav should report 16000 Hz and 1 channel. If a call fails, check the error table below.
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | API key missing or invalid | Re-export SAGEA_API_KEY with a valid key |
400 text_too_long | A prompt exceeds 4096 chars | Shorten that row and resubmit only that prompt |
422 voice_not_found | Voice name is wrong | Use nova or a valid voice_id starting with vox_ |
429 rate_limit_exceeded | Over 50 req per min on Starter, 500 on Pro | Use the batch endpoint and retry with backoff |
