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

# Bring your own key

> Run a model on your own provider account while the request still flows through SLNG.

Bring your own key (BYOK) runs a model on your own provider account instead of an
SLNG-hosted one. The request still flows through the SLNG Execution Layer, so
routing, fallbacks, and caching work the same way; only the model runs on your
account. You register the provider key once, and it is available to every project
in your organisation.

## When to use your own key

Prefer an SLNG-hosted model where one exists: it runs in your region and skips the
hop to an outside provider, which is the lowest-latency path. Reach for your own
key when one of these applies:

* **Provider relationship.** You already have contracts, pricing, or quota with
  the provider that you want to keep using.
* **Coverage.** A model or voice you need is not SLNG-hosted in your region.
* **Procurement or compliance.** The provider account must stay in your name.

A BYOK route leaves SLNG for your provider, so its latency depends on that
provider and its region, not on your SLNG region.

<Note>
  Need a model or provider that is not an SLNG model or available through BYOK?
  Email [support@slng.ai](mailto:support@slng.ai) and we will look at adding it.
</Note>

## Register a key

You register a provider key once, scoped to your organisation, so every project
can use it. For speech, BYOK covers the providers the vault lists; a model from
any other provider runs SLNG-hosted. For LLMs you register a custom model of your
own, so you are not limited to a list. See
[Add a custom LLM model](#add-a-custom-llm-model).

<Steps>
  <Step title="Open the BYOK vault">
    In your project, go to **Project Vault**, then **BYOK**. The page splits into
    **Speech models** and **LLM providers**. Click **Manage in SLNG Vault**.

    <Frame caption="Project Vault, BYOK. Open Manage in SLNG Vault.">
      <img src="https://mintcdn.com/slng-new-docs/_MURdOw87SJsfVag/heroshots/byok-vault.png?fit=max&auto=format&n=_MURdOw87SJsfVag&q=85&s=f526973cdec02464831fca05b4dea780" alt="The BYOK page in Project Vault, with the Manage in SLNG Vault button highlighted" width="2560" height="1600" data-path="heroshots/byok-vault.png" />
    </Frame>
  </Step>

  <Step title="Add a key in the organization vault">
    The organization vault opens on **SLNG Vault → BYOK**, with the same **Speech
    models** and **LLM providers** tabs. Click **Add key**.

    <Frame caption="The organization BYOK vault. Click Add key.">
      <img src="https://mintcdn.com/slng-new-docs/_MURdOw87SJsfVag/heroshots/byok-models.png?fit=max&auto=format&n=_MURdOw87SJsfVag&q=85&s=ec4b890467795f444e6bfeb14af593bf" alt="The organization BYOK vault with the Add key button highlighted" width="2560" height="1600" data-path="heroshots/byok-models.png" />
    </Frame>
  </Step>

  <Step title="Choose a model and paste your key">
    Set the **Type** (speech to text, text to speech, or LLM), then pick the
    **Model**. The **API key** field appears once a model is selected. Paste the
    key from your provider's dashboard, leave **Apply to** on **Organisation** so
    every project can use it, and click **Add key**. The key is stored encrypted
    and used automatically whenever that model is selected.

    <Frame caption="After you pick a model, the API key field appears. Paste your provider key.">
      <img src="https://mintcdn.com/slng-new-docs/_MURdOw87SJsfVag/heroshots/byok-models-add.png?fit=max&auto=format&n=_MURdOw87SJsfVag&q=85&s=b5ac2b98c084b64fa4e91e4fd29925b1" alt="The Add a speech model key dialog with a model selected and the API key field ready for a key" width="2560" height="1600" data-path="heroshots/byok-models-add.png" />
    </Frame>
  </Step>

  <Step title="Select it on your agent">
    The key now shows up on the BYOK page and in the **BYOK** tab of each model
    dropdown on **Listen**, **Think**, and **Speak**. Pick that model and the agent
    uses your key.
  </Step>
</Steps>

## Add a custom LLM model

The **LLM providers** tab is open: you register any provider endpoint rather than
picking from a list. The model runs on your provider account, and the
[Context Router](/guides/execution-layer/llm/context-router) routes to it.

<Steps>
  <Step title="Open the LLM providers tab">
    In the [BYOK vault](https://app.slng.ai/byok-models), open the **LLM
    providers** tab and click **Add key**.
  </Step>

  <Step title="Fill in the model details">
    In **Add an LLM provider**, enter:

    * **Model**: the model name your provider expects, such as `gpt-4o`.
    * **API key**: your provider key, from the provider's dashboard.
    * **Endpoint URL**: the provider's base URL.
    * **Provider** (optional): leave it on **Auto-detect**, or pick the provider.

    Click **Add key**. The key is stored encrypted, and you can update it anytime.

    <Frame caption="The Add an LLM provider dialog: model, API key, endpoint URL, and an optional provider.">
      <img src="https://mintcdn.com/slng-new-docs/fgzHSTXC7k7AhIuF/images/byok/add-llm-provider.png?fit=max&auto=format&n=fgzHSTXC7k7AhIuF&q=85&s=e00808fdae460afd50055f0894285bc8" alt="The Add an LLM provider dialog with Model, API key, Endpoint URL, and Provider fields" width="2520" height="1734" data-path="images/byok/add-llm-provider.png" />
    </Frame>
  </Step>

  <Step title="Select it on your agent">
    The model appears in the **BYOK** tab of the **Think** section's LLM dropdown.
    Pick it and the agent routes to your model.
  </Step>
</Steps>

For the full set of provider options (Azure, Vertex, custom auth headers, and
fallbacks), see [Create a client model](/api-reference/agents-resources/client-models/create).

## Use a BYOK model in code

Model IDs name where the model runs:

| Route                               | Runs on                                     |
| ----------------------------------- | ------------------------------------------- |
| `slng/deepgram/nova:3-en`           | SLNG infrastructure, in your region         |
| `deepgram/nova:3`                   | The provider, through SLNG. No key required |
| `deepgram/nova:3` + your credential | The provider, on your own account (BYOK)    |

Supply a BYOK credential one of two ways, and never attach one to an `slng/` model:

* **Registered credential (recommended).** A key stored in the vault is resolved
  automatically. Managed agents just select the model; direct calls send only
  `Authorization: Bearer $SLNG_API_KEY`.
* **Per-request header (direct model calls).** Send `X-Slng-Provider-Key` with
  `X-Slng-Agent-Id` and `X-Slng-Session-Id`, which are required. Managed agents
  never send this header.

## Next steps

* [Which models are available](/guides/models/which-models-are-available)
* [Configure Listen](/guides/agents/configure/listen),
  [Think](/guides/agents/configure/think), and
  [Speak](/guides/agents/configure/speak)
