API reference
Text to speech
Endpoints, request fields and response schemas for calling NeonAPI.
POST /v1/audio/speech
Authentication
Use your NeonAPI API key in Authorization: Bearer YOUR_API_KEY. Keep the key in a trusted application environment.
Availability and compatibility
Check the selected model’s protocol, permissions, price and supported parameters before calling. Unsupported parameters may be rejected. Request examples use placeholders.
Request fields
application/json
| Field | Type | Required | Constraints | Meaning |
|---|---|---|---|---|
model | string | Yes | — | Exact published model ID. |
input | string | Yes | — | Input in the format required by this endpoint. |
voice | string | Yes | alloy, echo, fable, onyx, nova, shimmer | Voice supported by the selected speech model. |
response_format | string | No | mp3, opus, aac, flac, wav, pcm; default: "mp3" | Desired output format where supported. |
speed | number | No | ≥ 0.25; ≤ 4; default: 1 | — |
Full field definitions, nested objects and referenced schemas are available in the downloadable specification.
Request example
export NEON_API_KEY="YOUR_API_KEY"
curl https://neon-api.com/v1/audio/speech \
-H "Authorization: Bearer $NEON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"input": "Welcome to NeonAPI",
"voice": "alloy"
}'Responses
Fields vary by model and protocol. The schema below describes the documented successful response; streams use protocol-specific events.
| Status | Meaning |
|---|---|
| 200 | Successful response |
Response schema
string
Download the user API OpenAPI specification
See errors and streaming & tasks.