Create speech
POST /v1/audio/speech turns text into one audio file. Authenticate with a bearer key.
Parameters
| Name | Values |
|---|---|
| input | Required. 1 to 2,000 characters. |
| model | spero-v1, the default. |
| voice | spero-f1 (female, the default) or spero-m1 (male). Both are US English. |
| response_format | mp3 (the default), wav, flac, opus or pcm (16-bit, 24 kHz, mono). |
These answer 400 with a plain message: stream: true, a speed other than 1, and any unknown voice.
Examples
Long text
Up to 600 characters render whole. Longer text is split at sentence ends, rendered in parts and joined, so a full 2,000 characters takes about 3 minutes. Set your client's timeout to match.
Speed
A two-sentence passage takes about 30 seconds, and a full 2,000 characters about 3 minutes, because each request renders six takes and keeps a clean one. Nothing is returned until the file is ready.
Response
On success, the body is the audio. These headers come with it:
| Header | Meaning |
|---|---|
| X-Model | The model that rendered it. |
| X-Voice | The voice that rendered it. |
| X-Characters | Characters charged. |
| X-Audio-Seconds | Length of the audio. |
| X-Cost-USD | What this request cost. |
| X-Queue-Wait-Ms | Time spent waiting in the queue. |
| X-Request-Id | The id shown on your Requests page. |
| X-Disclosure | AI-generated audio |
All audio from Spero is AI-generated. The terms say when you must tell your listeners.
Your data
Spero stores neither your text nor the audio. It records counts only: characters, audio length, cost and status.