TTS output_format and monthly spend limits on API keys
TTS output_format and monthly spend limits on API keys
output_format on speech and streaming
POST /v1/audio/speech and POST /v1/audio/stream now accept an output_format body parameter for a specific codec, sample rate, or bitrate. Existing callers do not need to change — when output_format is absent, the old defaults still apply.
Values use the codec_sampleRate_bitrate shape:
pcm_16000pcm_24000ulaw_8000mp3_24000_64mp3_24000_128wav_48000
output_format takes precedence over audio_format on /v1/audio/speech and over the Accept header on /v1/audio/stream. Invalid values return 400 and list the supported formats; the response echoes output_format when set. Telephony integrations should look at ulaw_8000 and pcm_16000; media pipelines at the mp3 bitrate variants. The full matrix is in the API reference.
Monthly USD spend limits on API keys
API keys can now carry a monthly USD spend limit. Once a key reaches its budget for the current calendar month, new requests fail with 402 spend_cap_exceeded until you raise the limit, use another key, or the month rolls over. Keys without a limit behave exactly as before.
The limit is per key, measured in US dollars through the same billing engine that produces your invoice, and covers speech synthesis, Agents calls, outbound batches, and LLM gateway usage where that key is the caller. The window is the calendar month in UTC and resets at 00:00 UTC on the first.
Handle spend_cap_exceeded separately from payment_required: the former means this key hit its budget, the latter means the workspace balance needs attention. In-flight calls are not cut off — the limit gates new requests. Set or edit a limit from the API Keys page; the secret does not change. See the spend limits guide.