For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
ModelsChatRankingsDocs
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
  • API Guides
    • Overview
    • Streaming
    • Embeddings
    • Limits
    • Authentication
    • Parameters
    • Errors and Debugging
  • API Reference
      • POSTCreate speech
LogoLogo
ModelsChatRankingsDocs
API ReferenceSpeech

Create speech

POST
https://openrouter.ai/api/v1/audio/speech
POST
/api/v1/audio/speech
$curl -X POST https://openrouter.ai/api/v1/audio/speech \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "input": "Hello world",
> "model": "elevenlabs/eleven-turbo-v2",
> "voice": "alloy",
> "response_format": "pcm",
> "speed": 1
>}'

Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).

Was this page helpful?
Previous

Create transcription

Next
Built with

Authentication

AuthorizationBearer
API key as bearer token in Authorization header

Request

This endpoint expects an object.
inputstringRequired
Text to synthesize
modelstringRequired
TTS model identifier
voicestringRequired

Voice identifier (provider-specific).

providerobjectOptional

Provider-specific passthrough configuration

response_formatenumOptionalDefaults to pcm
Audio output format
Allowed values:
speeddoubleOptional

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

Response

Audio bytes stream

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error