Skip to content

ElevenLabs text-to-speech (existing documentation) ​

This page preserves the existing New API integration documentation. The current gateway response has not been verified again: the old customer documentation describes a JSON audio link, while the current dreammis/sync2tts source returns binary audio. Confirm the deployed gateway response and billing configuration before integrating. An executable OpenAPI contract is pending this verification.

Authentication and endpoint ​

Create a customer API key in the gateway console. Send Authorization: Bearer YOUR_API_KEY and Content-Type: application/json to POST https://openai.2yanx.dpdns.org/v1/audio/speech.

Request parameters ​

ParameterTypeRequiredExisting documented behavior
modelstringyeseleven_v3
inputstringyesText to synthesize, at most 5000 characters
response_formatstringnomp3, the only documented format
voice_idstringnoVoice ID override; omission uses the configured default
stabilitynumbernoBetween 0 and 1
similarity_boostnumbernoBetween 0 and 1

Example ​

bash
curl 'https://openai.2yanx.dpdns.org/v1/audio/speech' \
  --header "Authorization: Bearer $XY_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"model":"eleven_v3","input":"Hello world","response_format":"mp3"}'

The existing customer documentation records this JSON response:

json
{
  "audio_url": "https://public-tts.2yanx.dpdns.org/newapi-tts-temp/...",
  "usage": {"prompt_tokens": 27, "completion_tokens": 0, "total_tokens": 27}
}

For that response, fetch audio_url to download or play the MP3 file. If the deployed gateway returns audio/mpeg instead, save the response body as audio directly. The exact response must be confirmed with the gateway operator; the upstream source alone does not establish the customer contract.

Errors and audio sample ​

The existing documentation records errors as {"detail":"Error details"}, including invalid keys, unknown model IDs, excessive input length, and upstream generation failures. Gateway errors can also follow the common gateway error format.

Download the existing audio sample.