Skip to content

Text to speech

Synthesize speech from text with preset, designed, or cloned voices.

Sprag synthesizes speech with Chorus, over an API that follows the OpenAI shape.

1

Get an API key

Create a Sprag account and open API keys in the app to generate one.

Copy the key immediately. The full value is shown once and is not recoverable after you leave the page.

Export it as an environment variable, replacing the placeholder with your key:

export SPRAG_API_KEY=<your_sprag_api_key>
2

Make a request

Point any OpenAI-compatible client at https://api.sprag.ai/v1 and pass Chorus as the model. The response body is the audio itself, not JSON.

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": "serena",
    "response_format": "mp3"
  }' \
  --output out.mp3
3

Pick a voice

serena above is one of 56 presets. List voices rather than hardcoding ids; the set can change. The listing takes no key, and model is required.

curl "https://api.sprag.ai/v1/audio/voices?model=chorus"

Where the voice comes from depends on the model you name and the field you send.

SendModelYou get
voicechorusOne of 56 preset speakers
instructionschorus-designA voice synthesized from your description
ref_audio and ref_textchorus-cloneA voice cloned from reference audio

Set model to chorus-design to design a voice; design runs only on that model. Sent to chorus with no voice, instructions produces the default speaker rather than a new voice.

Voices covers all three.

Where to go next

API. REST for text you already have, realtime for spoken conversation.

Voices. Presets, designed voices, and cloning.

Models. The three Chorus models, and where Symphony fits instead.

Concepts. Language coverage and audio formats.