> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slng.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ElevenLabs

> Route your ElevenLabs agent's language model through the SLNG context router. Speech to text and text to speech stay on ElevenLabs.

Keep your agent on ElevenLabs and route only its language model through the SLNG
context router. You get smart routing, context optimisation, in-region
execution, and compliant caching on every turn. Speech to text and text to
speech stay on ElevenLabs.

## Prerequisites

* A running ElevenLabs agent.
* An SLNG API key. See [Create your API key](/guides/get-started/quickstart#create-your-api-key).
* A BYOK LLM key registered in your org, so the router has a model to route to. See [Bring your own key](/guides/models/bring-your-own-key).

## Set up in the dashboard

<Steps>
  <Step title="Choose ElevenLabs">
    Start a new project, choose **Improve my agent**, and under **On a voice
    platform** pick **ElevenLabs**.

    <Frame caption="Pick ElevenLabs on the voice platform path.">
      <img src="https://mintcdn.com/slng-new-docs/_MURdOw87SJsfVag/heroshots/elevenlabs-select.png?fit=max&auto=format&n=_MURdOw87SJsfVag&q=85&s=44c0c29a6b06d3605740c35c686a4535" alt="New project chooser with the ElevenLabs voice platform highlighted" width="2560" height="1600" data-path="heroshots/elevenlabs-select.png" />
    </Frame>
  </Step>

  <Step title="Pick your model">
    Open the **Think** section and choose your LLM model. Keep **Context Router**
    on so the model routes through SLNG. Speech to text and text to speech stay
    on ElevenLabs.

    <Frame caption="Choose your model in the Think section.">
      <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/heroshots/voice-platform-think.png?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=2fa4ec0a6e82c37597d2890ed7d815e1" alt="Think section with the LLM model card highlighted, routed through SLNG" width="2560" height="1600" data-path="heroshots/voice-platform-think.png" />
    </Frame>
  </Step>
</Steps>

## In your ElevenLabs dashboard

Click **Integrate** in the top right. The modal fills in your router URL and
model, then walks you through the steps below in ElevenLabs.

<Frame caption="The LLM settings panel in ElevenLabs.">
  <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/images/integrate/elevenlabs-llm-settings.png?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=e136c375ed722136894f0cc4069fffc7" alt="ElevenLabs LLM settings panel with Custom LLM, Server URL, Model ID, API key, and request headers" width="5760" height="3600" data-path="images/integrate/elevenlabs-llm-settings.png" />
</Frame>

<Steps>
  <Step title="Open the agent">
    Open your [ElevenLabs agent](https://elevenlabs.io/app/agents) and click on
    **Agent** under **Configure**.
  </Step>

  <Step title="Open the LLM settings">
    Scroll down to the **LLM** section and open it. The LLM settings panel opens
    on the right.
  </Step>

  <Step title="Switch to a custom LLM">
    In the panel, under **LLM**, switch from the default to **Custom LLM**.
  </Step>

  <Step title="Set the server URL">
    In the **Server URL** field, paste
    `https://au.context-router.slng.ai/v1`. Swap `au` for the
    [region](/guides/regions/regions-map) closest to your callers. ElevenLabs
    adds the Chat Completions path.
  </Step>

  <Step title="Set the model ID">
    In the **Model ID** field, enter the model you picked in the **Think** section, for
    example `slng/auto`.
  </Step>

  <Step title="Add your API key as a secret">
    Under **API key**, click **Add new secret**, name it `SLNG_API_KEY`, paste
    your SLNG API key value, and click **Add secret**.
  </Step>

  <Step title="Send the authorization header">
    Under **Request headers**, click **Add header**. Select the **Secret** tab,
    set **Header name** to `Authorization` and select `SLNG_API_KEY` as the
    secret.
  </Step>

  <Step title="Add agent and session headers">
    Add two more request headers so the router can tie each turn to your agent
    and call. For each, select the **Variable** tab and map it to an ElevenLabs
    system variable:

    | Header name         | Dynamic variable          |
    | ------------------- | ------------------------- |
    | `X-Slng-Agent-Id`   | `system__agent_id`        |
    | `X-Slng-Session-Id` | `system__conversation_id` |

    <Frame caption="Map X-Slng-Agent-Id to the system__agent_id variable.">
      <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/images/integrate/elevenlabs-header-agent-id.png?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=28660c40cef1890cd58621c3fbf3faa3" alt="ElevenLabs Edit Request Header panel with X-Slng-Agent-Id mapped to the system__agent_id variable" width="1002" height="1452" data-path="images/integrate/elevenlabs-header-agent-id.png" />
    </Frame>

    <Frame caption="Map X-Slng-Session-Id to the system__conversation_id variable.">
      <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/images/integrate/elevenlabs-header-session-id.png?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=7e82bea47105f4a7d57fdeb80a509205" alt="ElevenLabs Edit Request Header panel with X-Slng-Session-Id mapped to the system__conversation_id variable" width="1002" height="700" data-path="images/integrate/elevenlabs-header-session-id.png" />
    </Frame>
  </Step>

  <Step title="Save and test">
    Save your changes and run a test conversation to confirm the LLM is routing
    through SLNG.
  </Step>
</Steps>

## Next steps

* [Integrating the context router](/guides/execution-layer/llm/context-router)
  for how routing works with your own keys or SLNG-hosted models.
