POST /v1/audio/speech
Text-to-speech endpoint.
Inference APIs
Synthesize audio from text and stream back the provider's binary audio response with the right content type.
POST/v1/audio/speech
Request
- Auth: tenant auth when enabled; otherwise dev mode is open
- Content-Type:
application/json - Max body size: 256 KiB
Request fields
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | yes | Alias or direct provider string |
input | string | yes | Text to synthesize |
voice | string | yes | Voice name |
response_format | string | no | Maps to audio content type; unsupported or omitted values default to audio/mpeg |
speed | number | no | Passed upstream when present |
Response handling
| Field | Type | Required | Notes |
|---|---|---|---|
| response body | binary | yes | Upstream audio payload |
Content-Type | header | yes | Preserved from upstream when set, otherwise derived from response_format |
Errors
| HTTP | Code | When |
|---|---|---|
400 | invalid_request_error | Malformed JSON or missing model, input, or voice |
400 | provider_not_configured | Provider missing from config or unavailable |
400 | invalid_request_error | Provider does not support speech |
502 | upstream_error | Upstream request failed |
Notes
- The response is binary, not JSON.
- The gateway preserves the upstream content type when possible.
- Format mapping falls back to
audio/mpegwhen no explicit match exists.