Skip to main content
POST
/
audio
/
speech
Create speech
curl --request POST \
  --url https://openrouter.ai/api/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "input": "Hello world",
  "model": "elevenlabs/eleven-turbo-v2",
  "response_format": "pcm",
  "speed": 1,
  "voice": "alloy"
}
'
"<binary audio data>"

Authorizations

Authorization
string
header
required

API key as bearer token in Authorization header

Body

application/json

Text-to-speech request input

input
string
required

Text to synthesize

Example:

"Hello world"

model
string
required

TTS model identifier

Example:

"elevenlabs/eleven-turbo-v2"

voice
string
required

Voice identifier (provider-specific).

Example:

"alloy"

provider
object

Provider-specific passthrough configuration

response_format
enum<string>
default:pcm

Audio output format

Available options:
mp3,
pcm
Example:

"pcm"

speed
number<double>

Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers.

Example:

1

Response

Audio bytes stream

Raw audio bytestream. Content-Type varies by requested format (audio/mpeg for mp3, audio/pcm for pcm — 16-bit little-endian).