Skip to Content
ModelSell Docs
Audio & MoreElevenLabs Audio Integration

ElevenLabs Audio Integration

Connect to native ElevenLabs HTTP and WebSocket APIs through ModelSell. Find models, parameters, examples, and billing details by capability.

Add /elevenlabs before an ElevenLabs native path when calling it through ModelSell. For example, /v1/text-to-speech/{voice_id} becomes /elevenlabs/v1/text-to-speech/{voice_id}. Model access, available voices, and prices depend on your ModelSell group and its upstream channel. ElevenLabs API reference

Choose a capability

TaskGuideMain response
Generate speech in a selected voice, with optional streaming or alignmentText to SpeechAudio bytes, alignment JSON, or WebSocket audio events
Transcribe a recording or receive a live transcriptSpeech to TextTranscript JSON, partial text, and committed text
Generate music from a prompt, composition plan, or uploaded videoMusicAudio, multipart results, stream events, or a composition plan
Synthesize dialogue in one or more voicesText to DialogueAudio, alignment data, or realtime audio events
Change a recording to a target voice while preserving its deliveryVoice ChangerConverted audio or audio stream
Generate voice previews from a written descriptionVoice DesignJSON containing voice previews
Generate short sound effects from textSound EffectsAudio bytes
Connect an agent that receives and returns audio in realtimeEleven RealtimeOpenAI Realtime-compatible events

Base URLs and authentication

Native HTTP and WebSocket routes accept either xi-api-key or Authorization: Bearer. Supply your ModelSell API Key and send the header when opening a WebSocket. Use Authorization: Bearer for the /v1/realtime compatibility route.

export MODELSELL_BASE_URL="https://api.modelsell.com"
export MODELSELL_WS_URL="wss://api.modelsell.com"
export MODELSELL_API_KEY="YOUR_MODELSELL_API_KEY"
export ELEVENLABS_VOICE_ID="YOUR_ELEVENLABS_VOICE_ID"

Supply model_id in the HTTP JSON body or multipart form, or in the query string for native realtime synthesis and transcription. Eleven Realtime uses the query parameter model. Specify the model explicitly for new integrations. When a route asks for a voice_id, choose a voice that your channel and selected model can access. Models · Voice Library

Make your first request

This request writes an MP3 and saves the response headers to speech.headers so you can inspect the request ID and any reported usage. Create speech

curl --fail-with-body \
  "$MODELSELL_BASE_URL/elevenlabs/v1/text-to-speech/$ELEVENLABS_VOICE_ID?output_format=mp3_44100_128" \
  -H "xi-api-key: $MODELSELL_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"model_id":"eleven_v4","text":"Hello, this is a speech synthesis example."}' \
  --dump-header speech.headers \
  --output speech.mp3

For the official Python SDK, set base_url to the ModelSell base URL followed by /elevenlabs, such as https://api.modelsell.com/elevenlabs. The SDK appends the native endpoint path and sets the xi-api-key header for supported HTTP methods. Official Python client · SDK URL handling

Usage and troubleshooting

CapabilityModelSell usage
HTTP Text to Speech and Text to DialogueUpstream character-cost when available, or an estimate from the submitted text
Realtime synthesis and dialogueEstimated from the Unicode characters sent
Voice Changer and both transcription modesAudio duration. Upload formats whose duration the gateway cannot measure require a configured per-request price
Voice Design, Sound Effects, and MusicPer request
Eleven Realtime voice agentsSession duration and reported input, output, and cached tokens

Use upstream response headers to inspect generation usage. Actual charges follow the current ModelSell prices and billing records. ElevenLabs generation usage headers

When a call fails, capture the HTTP status and the response's X-Oneapi-Request-Id, then check the following.

  1. Authentication and model access. Use a ModelSell API Key and confirm that the key and its group can call the model.
  2. The model, route, and voice combination. Use the capability guide to check route support and voice availability on the selected channel.
  3. Request encoding. Upload files as multipart form data, put query options such as output_format in the URL, and use each WebSocket route's event format.
  4. Upstream permissions. Voice Design and Eleven Realtime require the channel permissions voice_generation and convai_write, respectively.

HTTP errors use the ModelSell error format. Check each guide's gateway coverage for endpoints that manage upstream accounts and shared resources.

On this page