New: Audio API, Embeddings & Realtime WebSocket now available!
osmAPI LogoosmAPI

Create Speech

Generates audio from the input text

POST
/v1/audio/speech
modelstring

TTS model ID

inputstring

Text to generate audio for. Max 4096 characters.

Lengthlength <= 4096
voicestring

Voice to use. Options: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse

response_format?string

Audio output format

Default"mp3"
Value in"mp3" | "opus" | "aac" | "flac" | "wav" | "pcm"
speed?number

Speed of generated audio (0.25 to 4.0)

Default1
Range0.25 <= value <= 4
instructions?string

Natural language instructions for voice tone/emotion. Only supported by gpt-4o-mini-tts.

Response Body

curl -X POST "https://api.osmapi.com/v1/audio/speech" \  -H "Content-Type: application/json" \  -d '{    "model": "tts-1",    "input": "string",    "voice": "alloy"  }'
Empty

How is this guide?