> For the complete documentation index, see [llms.txt](https://docs.interactive.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.interactive.ai/settings/custom-llms.md).

# Custom LLMs

Custom LLMs covers two things.&#x20;

* **LLM Connections** store credentials for providers you want to reach directly rather than through the Router.&#x20;
* **LLM Configurations** define how a model is recognised in your traces and what it costs, which is what makes cost tracking work for calls that do not pass through the Router.&#x20;

### Connections

A connection stores the credentials the platform uses to reach an external provider: a display name, the provider type that determines the API schema, the endpoint, and the key itself. Leave the endpoint at its default for the provider's standard API, or set your own for a self-hosted or proxied deployment. Extra headers can be attached where a provider expects them.

You can hold several connections for the same provider, which is how teams keep production and development keys apart, or reach two accounts with one project.

Connections are what let an evaluator run against a model of your own rather than one the Router offers.

<div data-with-frame="true"><figure><img src="https://708770081-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ICwJbq7EJdn5kBgXnQu%2Fuploads%2FYLG2ZoofdTaoD1h1KRTF%2FScreenshot%202026-08-10%20at%2013.11.55.png?alt=media&amp;token=eb7f12d9-10da-4b47-80fd-2d73196e3909" alt=""><figcaption></figcaption></figure></div>

#### Adding a Connection

Click the **+** button in the top-right corner to open the Add LLM Connection modal.

| Field             | Description                                                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **Provider name** | A display name to identify this connection within InteractiveAI (e.g., "OpenAI Production", "Gemini")                     |
| **LLM adapter**   | The provider type that determines the API schema. Options include `openai`, `google-ai-studio`, `anthropic`, and others   |
| **API Base URL**  | Leave as `default` to use the provider's standard endpoint, or enter a custom URL for self-hosted or proxy configurations |
| **API Key**       | Your provider's API key. Stored encrypted in the database                                                                 |
| **Extra Headers** | Optional HTTP headers to include with requests (also stored encrypted)                                                    |

{% hint style="info" %}
You can create multiple connections for the same provider. This is useful for separating production and development keys, or for connecting to different accounts.
{% endhint %}

### Configurations

A configuration tells the platform how to recognise a model in your traces and what it costs, which is what makes cost tracking work for calls that never touch the Router. Each one carries the model name, a match pattern used to identify it, and a tokenizer.

<div data-with-frame="true"><figure><img src="https://708770081-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ICwJbq7EJdn5kBgXnQu%2Fuploads%2FdBOMxg6EE99xlMjhpmmE%2FScreenshot%202026-08-10%20at%2013.12.46.png?alt=media&amp;token=096e4ea4-9f8a-40e8-a7a1-4a0f01836caf" alt=""><figcaption></figcaption></figure></div>

The catalogue arrives populated. Hundreds of definitions ship with the platform and are maintained by InteractiveAI, so you are adding to an existing list rather than starting from nothing, and only when you are using a model it does not already know.

#### Adding a Model Definition

Click **Add Model Definition** to open the configuration modal.

<div data-with-frame="true"><figure><img src="https://708770081-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ICwJbq7EJdn5kBgXnQu%2Fuploads%2FDsDVtJpekanlQlJ9fUe3%2FScreenshot%202026-08-10%20at%2013.26.12.png?alt=media&amp;token=83c45b8f-804d-4074-8639-e2c09b23cdac" alt=""><figcaption></figcaption></figure></div>

Pricing is set per usage type, and the usage types have to match the keys in the usage data you send exactly. Input and output cover most providers; some also bill for cached reads, which is a separate type again. The dialog previews what you have entered per unit, per thousand, and per million, which is the quickest way to catch a price entered at the wrong order of magnitude.

{% hint style="info" %}
None of this is needed if you reach models through the [Router,](broken://pages/L6ArA8A7upmhPk2wNleO) which handles provider credentials and cost tracking on its own.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.interactive.ai/settings/custom-llms.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
