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
| Task | Guide | Main response |
|---|---|---|
| Generate speech in a selected voice, with optional streaming or alignment | Text to Speech | Audio bytes, alignment JSON, or WebSocket audio events |
| Transcribe a recording or receive a live transcript | Speech to Text | Transcript JSON, partial text, and committed text |
| Generate music from a prompt, composition plan, or uploaded video | Music | Audio, multipart results, stream events, or a composition plan |
| Synthesize dialogue in one or more voices | Text to Dialogue | Audio, alignment data, or realtime audio events |
| Change a recording to a target voice while preserving its delivery | Voice Changer | Converted audio or audio stream |
| Generate voice previews from a written description | Voice Design | JSON containing voice previews |
| Generate short sound effects from text | Sound Effects | Audio bytes |
| Connect an agent that receives and returns audio in realtime | Eleven Realtime | OpenAI 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.mp3For 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
| Capability | ModelSell usage |
|---|---|
| HTTP Text to Speech and Text to Dialogue | Upstream character-cost when available, or an estimate from the submitted text |
| Realtime synthesis and dialogue | Estimated from the Unicode characters sent |
| Voice Changer and both transcription modes | Audio duration. Upload formats whose duration the gateway cannot measure require a configured per-request price |
| Voice Design, Sound Effects, and Music | Per request |
| Eleven Realtime voice agents | Session 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.
- Authentication and model access. Use a ModelSell API Key and confirm that the key and its group can call the model.
- The model, route, and voice combination. Use the capability guide to check route support and voice availability on the selected channel.
- Request encoding. Upload files as multipart form data, put query options such as
output_formatin the URL, and use each WebSocket route's event format. - Upstream permissions. Voice Design and Eleven Realtime require the channel permissions
voice_generationandconvai_write, respectively.
HTTP errors use the ModelSell error format. Check each guide's gateway coverage for endpoints that manage upstream accounts and shared resources.