> ## 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.

# Vapi

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

Keep your assistant on Vapi 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 Vapi.

## Prerequisites

* A running Vapi assistant.
* 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 Vapi">
    Start a new project, choose **Improve my agent**, and under **On a voice
    platform** pick **Vapi**.

    <Frame caption="Pick Vapi on the voice platform path.">
      <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/heroshots/vapi-select.png?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=d33c16c6b577a1e11e478fa3ef7bdecb" alt="New project chooser with the Vapi voice platform highlighted" width="2560" height="1600" data-path="heroshots/vapi-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 Vapi.

    <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 Vapi dashboard

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

<Frame caption="The Model Settings panel in Vapi.">
  <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/images/integrate/vapi-model-settings.jpg?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=30012ea7e5cb4ab8bfeb85faa0ebd668" alt="Vapi Model Settings panel with the Custom llm provider, Model, and Custom LLM URL fields" width="3497" height="2186" data-path="images/integrate/vapi-model-settings.jpg" />
</Frame>

<Steps>
  <Step title="Open Model Settings">
    Open your [Vapi assistant](https://dashboard.vapi.ai/assistants) and click
    the edit icon on the **Model card** to open **Model Settings**.
  </Step>

  <Step title="Select the custom LLM provider">
    In the **Provider** dropdown, select **Custom llm**.
  </Step>

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

  <Step title="Set the custom LLM URL">
    In the **Custom LLM URL** field, paste
    `https://au.context-router.slng.ai/v1/chat/completions`. Swap `au` for the
    [region](/guides/regions/regions-map) closest to your callers.
  </Step>

  <Step title="Add your API key">
    Go to **Integrations** at the bottom of the side menu. Under **Model
    Providers**, click the **Custom LLM** card and enter your SLNG API key in the
    **API Key** field. Click **Save**.
  </Step>

  <Step title="Add agent and session headers">
    Under **Headers** for the custom LLM, add these values:

    | Header              | Value              |
    | ------------------- | ------------------ |
    | `X-Slng-Agent-Id`   | `{{assistant.id}}` |
    | `X-Slng-Session-Id` | `{{call.id}}`      |
  </Step>

  <Step title="Publish and test">
    Click **Publish** 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.
