Skip to main content

Overview

ElevenLabs is a specialized audio provider for text-to-speech and speech-to-text operations. Bifrost performs conversions including:
  • Model ID mapping - Uses provider model identifier directly
  • Voice configuration - Maps voice settings (stability, similarity, boost, speed, style)
  • Response format conversion - Speech format handling (MP3, Opus, PCM/WAV)
  • Timestamp support - Character-level timing alignment for TTS
  • Transcription with alignment - Word and character-level timing, diarization, and additional formats
  • Pronunciation dictionaries - Support for custom pronunciation rules
  • Voice quality parameters - Stability, similarity boost, and speaker boost controls

Supported Operations

Unsupported Operations (❌): Chat Completions, Responses API, Text Completions, and Embeddings are not supported by ElevenLabs (audio-focused provider). These return UnsupportedOperationError.Note: ElevenLabs also supports a “Speech with Timestamps” endpoint at /v1/text-to-speech/{voice_id}/with-timestamps (non-streaming only) for enhanced timestamp information.

Setup & Configuration

Configure ElevenLabs as a provider.
ElevenLabs provider dashboard
  1. Navigate to Models > Model Providers. Look for ElevenLabs under Configured Providers. If it is missing, click on Add New Provider and select ElevenLabs.
  2. Click Add Key or edit an existing key.
  3. Set a name for your key.
  4. Paste your API key directly or use an environment variable (for example, env.ELEVENLABS_API_KEY).
  5. Set Allowed Models to All Models (default) or the specific model allowlist you want this key to serve.
  6. Save the provider configuration.
For text-to-speech calls, the Bifrost model is the ElevenLabs voice ID unless you pass a provider-specific voice override in the request.

1. Speech (Text-to-Speech)

Request Parameters

Core Parameters

Voice Configuration

Voice settings are optional and controlled via params:

Advanced Parameters

Use extra_params for ElevenLabs-specific TTS features:

Advanced TTS Parameters

Response Format

Defaults to MP3 format if not specified. Format is passed via query parameter output_format.

Timestamps Support

To get character-level timing alignment, enable with_timestamps:
When enabled, the endpoint /v1/text-to-speech/{voice_id}/with-timestamps is used and the response includes:
  • audio_base64 - Audio data as base64-encoded string
  • alignment.char_start_times_ms - Character start times in milliseconds
  • alignment.char_end_times_ms - Character end times in milliseconds
  • alignment.characters - Array of characters
  • normalized_alignment - Same as alignment but for normalized text

Response Conversion

Non-Timestamp Response

Timestamp Response

Streaming

Streaming speech returns audio in chunks as they are generated:
Final chunk:

2. Sound Effects (Text-to-Sound)

ElevenLabs sound-effects models (e.g. eleven_text_to_sound_v2) generate sound effects from a text prompt via the upstream POST /v1/sound-generation API. This is a different endpoint from text-to-speech and does not use a voice. Call POST /v1/audio/speech with a sound model — the provider detects a sound model by its id and routes internally to sound generation, so no separate endpoint is needed (SDK and transport APIs stay at parity). Because it stays a speech request, virtual-key governance (provider/model allowlists, budgets, rate limits) applies to eleven_text_to_sound_v2 like any other model.

Request Parameters

input is a top-level string here (not a nested object). duration_seconds, loop, and prompt_influence are sent as top-level fields and forwarded as sound-generation parameters. No voice is sent — the provider detects the sound model and skips the voice requirement.

Response

Returns binary audio (same delivery as text-to-speech). When duration_seconds is provided, the response usage carries audio_seconds (the requested duration) for observability and future duration-based pricing.

Notes

Billing

ElevenLabs itself bills sound effects per generated second. In Bifrost the dollar cost is only computed when the model catalog has a pricing entry for it:
  • The default pricing datasheet (getbifrost.ai/datasheet) does not currently include eleven_text_to_sound_v2, so without extra configuration the request is recorded with cost = 0.
  • To bill it today, add a pricing override for the model (works with any config store, e.g. SQLite — no Postgres required). The speech cost path currently bills on input characters, so an override that sets input_cost_per_character takes effect immediately, e.g. {"input_cost_per_character":0.00018}.
  • output_cost_per_second is the field that will reflect ElevenLabs’ real per-second pricing, but it only takes effect once the audio_seconds wiring lands; until then it is recorded but not applied.

3. Transcription (Speech-to-Text)

Request Parameters

Input Source

Choose one of the following (mutually exclusive): Error: Providing both or neither will result in error.

Core Parameters

Advanced Parameters

Use extra_params for transcription-specific features:

Transcription Options

Additional Formats

Request multiple output formats simultaneously:
Supported formats: segmented_json, docx, pdf, txt, html, srt

Response Conversion

Basic Transcription

With Diarization

When diarize: true, the response includes speaker identification:

With Timestamps

Character-level timing when timestamps_granularity: "character":

With Additional Formats


Caveats

Severity: High Behavior: Voice ID must be provided for TTS requests Impact: Request fails without voice configuration Code: elevenlabs.go:198-208
Severity: High Behavior: Either file or cloud_storage_url must be provided (not both) Impact: Request fails with ambiguous input Code: elevenlabs.go:471-478
Severity: Low Behavior: Response formats (MP3, Opus, WAV) mapped via format string Impact: Format parameter passed as query string to endpoint Code: elevenlabs.go:712-715, utils.go:5-35
Severity: Low Behavior: Timestamp requests use /with-timestamps endpoint variant Impact: Switches endpoint based on with_timestamps flag Code: elevenlabs.go:195-205
Severity: Low Behavior: Transcription uses multipart/form-data, not JSON Impact: File and parameters sent as form fields Code: elevenlabs.go:480-690

4. List Models

Request Parameters

Returns available models with their capabilities and language support.

Response Conversion