Models Hub
API ReferenceAudio & Others

Text-to-speech.

Convert text to audio.

Edit this page
POST
/v1/audio/speech

Authorization

bearerAuth
AuthorizationBearer <token>

Authenticate using an Authorization Bearer API Key.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

audio/mpeg

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