/audio/speechCreate speech from text
Generates audio from text using a selected text-to-speech model and voice. Provide model, input, and voice, then choose an output format or streaming mode as needed. The response contains audio data or streamed audio events.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Text-to-speech request configuration. model, input, and voice are required.
One documented failure
slow_downYour request rate increased too quickly. Please reduce the request rate and gradually increase it again.
Traffic increased too quickly
One documented failure
server_is_overloadedThe model is temporarily overloaded. Please retry your request after a brief delay.
The requested model is temporarily overloaded
A 400 is returned for an invalid speech request, input, output format, or voice; a 401 indicates a missing or revoked API key or an unauthorized client IP; and a 403 indicates organization policy blocks access. A 429 indicates a rate limit was exceeded, a 500 indicates the voice or audio could not be processed, and a 503 indicates temporary service unavailability. model, input, and voice are required; input and instructions must not exceed 4,096 characters, speed must be between 0.25 and 4, and response_format and stream_format must use supported values.