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

# Licenses and who pays

> The order the AI Gateway follows to decide who pays for each call.

Every call is paid one of three ways, called license models, and the gateway picks one per call in a fixed order.

![Diagram](https://docs.xpander.ai/images/diagrams/run-llm-gateway-which-key-pays-c8e2d714.svg)

| License model | Who pays | Credits | Budgets |
| - | - | - | - |
| **Xpander AI Credits** | xpander, on its own provider keys | Billed in credits | Counts |
| **Bring your own key** | Your organization, on a provider key you stored | None for model calls. Your provider bills you. On xpander cloud, agent turns pay the session-hour rate | Counts, at the cost the gateway measures |
| **Bring your own subscription** | The person, on their own Claude plan | None for model calls. On xpander cloud, agent turns pay the session-hour rate | Not counted in budgets |

The session-hour rate is 8 credits for each active hour of an agent turn whose model calls run on your own key or plan ([What a run costs](https://docs.xpander.ai/use/agents/budgets.md#what-a-run-costs)). Credits, and so this rate, apply on xpander cloud only ([Cloud, Hybrid and Air-Gapped](#cloud-hybrid-and-air-gapped)).

Admins choose which ones people may use in [Policies](https://platform.xpander.ai/governance/policies) ([License model](https://docs.xpander.ai/run/llm-gateway/policies.md#license-model)).

## 1. A person's own Claude plan

> [!NOTE]
>
> To turn it on for your organization, contact xpander.

On xpander cloud, when xpander has turned it on for your organization, anyone with a Claude plan can bring it. The plan, including its extra usage, then pays for two kinds of calls:

* **Their agents in xpander.** Claude Code agents that run for them, Omni included. See [Agent runs that use a plan](#agent-runs-that-use-a-plan).
* **Claude Code on their own computer**, signed in with their Claude plan and sending their xpander key in the `x-xpander-api-key` header.

In both cases the model must be a Claude model from Anthropic, and **Bring your own subscription** must be on for the person's organization, group and agent.

Otherwise the call is refused with a message naming what is missing. It is never silently moved to company models.

> [!WARNING]
>
> Anthropic's [Claude Code legal and compliance page](https://code.claude.com/docs/en/legal-and-compliance#acceptable-use) says: "Advertised usage limits for Pro, Max, and Ultra plans assume ordinary, individual usage of Claude Code and the Agent SDK." Don't run a team bot or a shared, always-on agent on one person's plan. Use a company key for it.

### Agent runs that use a plan

The plan also pays for Claude Code agents that xpander runs, when the person the run acts for connected their Claude plan and picked it in the model picker for that agent. Another person's plan pays only when it is pinned to the agent ([Pin a plan to an agent](#pin-a-plan-to-an-agent)).

The plan covers the model usage of the run. Your organization pays the session-hour rate for it, on xpander cloud.

| The run is started by | Whose plan pays |
| - | - |
| A person, in xpander Chat or a channel | That person's plan |
| A schedule | The plan of the person the schedule runs as |
| A webhook or an API call | The plan of the person the call runs as: the person who owns the API key, or else the agent's default user |
| Nothing that names a person | No plan. The run uses company models (step 2) |

A person connects their plan in the model picker of a conversation in [xpander Chat](https://chat.xpander.ai), under **Subscriptions**.

The plan cannot pay for:

* An agent whose Claude Code runs on a Bedrock model, or on a provider other than Anthropic. An admin can move the agent to an Anthropic model.
* An agent that is not a Claude Code agent.

When that plan is limited or its login expired:

* **In xpander Chat**, the turn stops, and the conversation shows a notice with **Continue on organization models**. The turn waits until the person clicks it. When the admin's **When someone's plan hits its limit** or the person's own **When my Claude plan hits its limit** is **Pause**, the notice has no such button, and the turn is refused until the plan resets or the person reconnects it.
* **Any other run** (a channel, a schedule, a webhook or an API call) has no one to ask, so it runs on company models and the person gets a notification. When either setting is **Pause**, the run is refused with `plan_unavailable` instead, nothing is charged, and the person gets a notification.

### Pin a plan to an agent

Someone who can edit an agent can pin their own connected Claude plan to it, in the agent's settings under **Advanced** > **Billing** > **Subscription plan**. A pin makes that one plan pay for every person's turns on the agent, not only the pinner's, and the pinner answers for the plan's terms. A turn that names no person never runs on a pin.

Picking your plan in the model picker already covers your own turns. A pin adds the turns of everyone else on the agent. The Warning above applies to a pin. Pin a plan only to an agent that you alone use. Run a team agent, a bot or an always-on agent on company models instead: a key your organization stored, or xpander's key ([Company models](#2-company-models)).

**When the plan cannot serve** sets what the agent's turns do while the pinned plan is limited or signed out: **Use the org's models** (the default), **Wait until it resets** or **Stop the turn**. When **When someone's plan hits its limit** is **Pause**, the turns wait instead of using company models.

### When the plan hits its limit

**When someone's plan hits its limit** in [Policies](https://platform.xpander.ai/governance/policies) decides what happens until the plan resets:

* **Fall back to company models** (default): the call continues as in step 2, and the person sees their plan is limited and when it resets. Each person can still choose **Pause** under **When my Claude plan hits its limit** in [AI models & keys](https://chat.xpander.ai/?settings=my-gateway). These calls are paid like any company call: per token on your stored key, or in credits on xpander's key, and they count toward budgets.
* **Pause**: the call is refused until the reset, and nothing is charged. The choice is locked for everyone, with *Your admin set calls to pause when a plan hits its limit*.

AI models & keys shows a limited plan, for example *Your Claude plan's usage limit is reached until Thu, Oct 8, 8:00 AM. Calls use company models until then.*

## 2. Company models

Every other call, and any call a limited plan falls back from, runs on a key your organization stored or on xpander's key. **Default license model** in [Policies](https://platform.xpander.ai/governance/policies) decides which:

| Default license model | A key is stored for the provider | No key is stored |
| - | - | - |
| **Bring your own key** | Your key. The provider bills you, no credits used | xpander's key in credits, when **Xpander AI Credits** is on. Otherwise refused, naming the provider that needs a key |
| **Xpander AI Credits** | xpander's key in credits. Your key is not used | xpander's key in credits |

With **Bring your own key**, the first stored key assigned to the agent, the person, their primary group or the organization wins ([Whose key pays](https://docs.xpander.ai/run/llm-gateway/providers-and-keys.md#whose-key-pays)).

## Cloud, Hybrid and Air-Gapped

| Your organization runs on | Keys a call can use |
| - | - |
| xpander cloud | A person's own Claude plan, your stored keys, and xpander's keys when **Xpander AI Credits** is on |
| Hybrid | Agents on your install: your stored keys and your install's credentials. People's coding tools (through xpander cloud): their own Claude plan and your stored keys. Never xpander's keys |
| Air-Gapped | Your stored keys and your install's credentials |

On Hybrid and Air-Gapped, every provider your agents use needs a key in **Platform > AI governance > Models** or on the install (`secrets.static`). A call with neither is refused, naming the missing key. Agents of the same organization running in xpander cloud may still use **Xpander AI Credits**.

## See who paid

A request in [Logs](https://platform.xpander.ai/governance/logs) shows its **License model**, and its **Gateway decisions** show which key served it and why. The **Paid by** column names the payer of each call or trace, and the **Paid by** filter narrows Logs to one license model or one of your stored provider keys. [Usage](https://platform.xpander.ai/governance/usage) splits spend into **Xpander AI Credits**, **Your provider keys** and **Subscription: personal Claude plans**. A ChatGPT plan cannot pay for calls. Only a Claude plan can.

## Next steps

> [card] [Choose license models](https://docs.xpander.ai/run/llm-gateway/policies.md#license-model)
>
> The License model setting.

> [card] [Assign keys](https://docs.xpander.ai/run/llm-gateway/providers-and-keys.md#whose-key-pays)
>
> Whose key pays.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.