SimpleLLMDocs
HTTP API
Markdown ↗

Generate speech audio

POST /v1/audio/speech

Base URL: https://api.simplellm.eu. Authenticate using Authorization: Bearer $SIMPLELLM_API_KEY.

Request body

Content-Type: application/json

FieldTypeRequiredMeaning
modelstringNoDefault: "tts-1".
inputstringYesAt most 4096 UTF-8 bytes (not Unicode characters).
voicestringNoDefault: "alloy". Values: alloy, echo, fable, onyx, nova, shimmer.
response_formatstringNoDefault: "mp3". Values: mp3, opus, aac, flac, wav, pcm.
speednumberNoDefault: 1. Minimum: 0.25. Maximum: 4.

Nested required fields are required only when their containing object is supplied. Extra chat parameters may be provider-specific; acceptance does not guarantee model support.

Example request

bash
curl --fail-with-body https://api.simplellm.eu/v1/audio/speech \
  -H "Authorization: Bearer $SIMPLELLM_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "tts-1",
  "input": "Hello from SimpleLLM.",
  "voice": "alloy",
  "response_format": "mp3"
}' \
  --output speech.mp3

Responses

HTTP 200

Audio bytes in the requested format.

Content-Type: audio/mpeg

Response type: string.

Content-Type: audio/opus

Response type: string.

Content-Type: audio/aac

Response type: string.

Content-Type: audio/flac

Response type: string.

Content-Type: audio/wav

Response type: string.

Content-Type: audio/pcm

Response type: string.

Error handling

Errors can occur in authentication, billing, routing or the upstream service; not every status applies to every route.

StatusMeaning
400Invalid request
401Invalid credentials
402Insufficient credits
403Access denied
404Model or resource not found
429Rate or capacity limit
500Internal error
502Routing or upstream error
503Temporarily unavailable
504Deployment timeout

See Troubleshooting for response examples and Rate limits & retries for retry rules.

Machine-readable schema

Download OpenAPI JSON. Operation ID: createSpeech.

Search the complete documentation.