Voice presets
Speak in one of the built-in speakers, the same on every request.
Overview
Presets are the built-in speakers. Pass a preset id as voice, and the same
speaker reads every request.
curl https://api.sprag.ai/v1/audio/speech \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SPRAG_API_KEY" \
-d '{
"model": "chorus",
"input": "The quarterly numbers are in and they look good.",
"voice": "dominic",
"response_format": "mp3"
}' \
--output out.mp3List presets
GET /v1/audio/voices?model=chorus lists the presets. List the voices rather
than hardcoding an id. The set can change.
curl "https://api.sprag.ai/v1/audio/voices?model=chorus" \
-H "Authorization: Bearer $SPRAG_API_KEY"Each entry carries the id to pass as voice, a name, and a description.
For a playable sample of each voice, use the voice library in
the app.
If voice names no voice in the listing, the request returns HTTP 400 with the
error code unknown_voice.
Accent and language
Every preset reads any supported language. A voice's listed language names the accent the speaker carries, not a limit on what they read. A voice listed as German reads English, and sounds like a German speaker reading English.
To define a speaker in words rather than pick one, see Voice design.