---
title: "BYOK & LLM providers"
description: "Bring your own LLM keys per tenant: providers and two model-wiring paths — native OpenAI-compatible and via an LLM gateway. No paid model is ever required."
updated: "2026-11-09"
---

Connect a real model provider to receive working answers. A paid API key is not required: use a local OpenAI-compatible model, a supported subscription, or your own API key.

When you do want a specific model, you bring it yourself —
either as a process-wide configuration or, per tenant, with **BYOK** ("bring your
own key").

## Supported LLM providers

AiHummer speaks natively to any provider that exposes an OpenAI-style chat API,
reaches other providers through an external LLM gateway, and supports the
ChatGPT-subscription transport. In practice that covers:

| Provider | How it connects | Notes |
|---|---|---|
| **OpenAI** | Native OpenAI-compatible path (`AIHUMMER_OPENAI_*`) | |
| **Any OpenAI-API-standard endpoint** | The same native path: `AIHUMMER_OPENAI_BASE_URL` | Local models, OpenRouter, Gemini's OpenAI-compatible API, etc. |
| **Anthropic** | Web-UI **Anthropic** preset (OpenAI-compatible) or via the LLM gateway (`AIHUMMER_LLM_*`) | Claude models; connect it from the branded provider picker, or let the sidecar gateway hold the key |
| **Codex / ChatGPT-subscription transport** | Subscription-based transport (`AIHUMMER_CODEX_*`) | Uses a ChatGPT subscription rather than a metered API key |

> [!WARNING]
> Connect a real model provider to receive working answers. A paid API key is not required: use a local OpenAI-compatible model, a supported subscription, or your own API key.

## Wiring a model with settings

The LLM keys are **settings-catalog** knobs (stored in the database): set them
in the admin UI (Management → Settings) or with `aihummer settings set`, not in
`gateway.env`. There are **two independent wiring paths** — do not mix their
variables.

**(a) The native OpenAI-compatible path.** The gateway calls an
OpenAI-compatible endpoint itself and passes the key itself:

```bash
aihummer settings set AIHUMMER_OPENAI_API_KEY sk-...
aihummer settings set AIHUMMER_OPENAI_BASE_URL https://api.openai.com/v1
aihummer settings set AIHUMMER_OPENAI_MODEL gpt-4o-mini
```

The same path works for a local OpenAI-compatible server, OpenRouter or
Gemini's OpenAI-compatible endpoint — just point `AIHUMMER_OPENAI_BASE_URL` at it.

**(b) The LLM-gateway path.** `AIHUMMER_LLM_GATEWAY_URL` is the base URL of an
OpenAI-compatible endpoint — this is the same setting shown in
[Configuration](/en/v1.7/getting-started/configuration/). Point it at a gateway
sidecar that **holds the provider keys itself** (no API key passes through
AiHummer), or directly at a provider's OpenAI-compatible API (in which case you
also supply that provider's key). It is distinct from the native
`AIHUMMER_OPENAI_BASE_URL` in path (a):

```bash
aihummer settings set AIHUMMER_LLM_GATEWAY_URL http://127.0.0.1:8090
aihummer settings set AIHUMMER_LLM_PROVIDER anthropic
aihummer settings set AIHUMMER_LLM_MODEL claude-sonnet-4-5
```

> [!WARNING]
> The paths do not combine: pairing `AIHUMMER_LLM_GATEWAY_URL` with
> `AIHUMMER_OPENAI_API_KEY` does nothing — no key is forwarded on the gateway
> path; the sidecar uses its own keys.

If no provider is configured, the error is: `No AI model provider is configured yet — add one in the Models section`

## BYOK: per-tenant keys

Where the environment variables configure a single process-wide model, **BYOK**
lets each tenant supply its own LLM credentials. BYOK keys are managed from the
admin API:

```http
GET  /v1/admin/byok
POST /v1/admin/byok
```

BYOK keys are stored in the encrypted vault, just like every other credential —
they are never written to logs or surfaced in the model context. This is what
lets a multitenant deployment keep each customer's model billing and key
material fully separate.

## Choosing between shared settings and BYOK

- Use the **`AIHUMMER_OPENAI_*` / `AIHUMMER_LLM_*` settings** for a
  single-tenant or default model that the whole gateway should use.
- Use **BYOK** when different tenants must use different keys, different
  providers, or be billed separately — the per-tenant key overrides the default
  for that tenant.

> [!TIP]
> Because any OpenAI-API-standard endpoint is accepted, you can point
> `AIHUMMER_OPENAI_BASE_URL` at a local model server, OpenRouter, or a Gemini
> OpenAI-compatible endpoint without changing anything else in AiHummer.

## How this relates to the rest of the access model

BYOK keys are model credentials and live in the same encrypted vault as
[Connections](/en/v1.7/access/connections-oauth2/) and shared/personal secrets.
The difference is scope: BYOK answers *which model and key this tenant uses*,
while the [personal vs shared](/en/v1.7/access/personal-vs-shared/) scope answers
*whose credentials a given tool call runs with*.

## Where to next

- [Personal vs shared credentials](/en/v1.7/access/personal-vs-shared/)
- [Connections (per-user OAuth2)](/en/v1.7/access/connections-oauth2/)
- [Introduction](/en/v1.7/getting-started/introduction/) — the no-paid-models
  principle in context.
