# Platform models or BYOK

Source: https://platform.lyrouter.com/ai_gateway/docs/byok-choice/en
Last updated: 2026-10-19

LYRouter models come from two kinds of source. A platform source uses provider channels and credentials supplied by LYRouter and is charged to your Credits balance by usage. BYOK (Bring Your Own Key) uses your own API key with the provider: the provider bills you for upstream usage, and LYRouter charges a fixed service fee for each successful BYOK call. Both are called with the same LYRouter API key and the same model ID, they can exist side by side, and the gateway chooses between them according to its routing rules.

## Comparing the two sources

| Aspect | Platform source | BYOK |
| --- | --- | --- |
| What you need | A Credits balance | A provider account and API key (pay-as-you-go API or Coding Plan) |
| Where to set it up | Enable models in **Model marketplace** | Add a channel in **BYOK** |
| Upstream cost | Deducted from Credits at platform prices | Billed to your account by the provider |
| LYRouter charges | Credits deducted by usage | A fixed service fee for each successful call |
| Supported models | Every model the platform offers, including image, video, audio and embedding models | Only chat models with text output |
| Providers you can connect | Providers listed on the platform | Providers in the Official model providers list, plus any custom provider |
| Quota and concurrency | The platform channel's quota | Your own account quota and concurrency with the provider |
| Sources filter in the model marketplace | Third-party | BYOK |

(Screenshot: The Sources filter in the model marketplace narrows models to Third-party or BYOK sources.)

## When to use which

Platform sources suit you when:

- You do not want to manage provider accounts and just want to enable a model and call it.
- You need image, video, audio or embedding models.
- You want all costs settled in Credits.

BYOK suits you when:

- You already have pay-as-you-go quota, discounts or a Coding Plan subscription with a provider and want to keep using it.
- You need a provider the platform does not offer, or want to connect an enterprise proxy or an aggregator; connect it as a Custom provider.
- Compliance requires calls to go through a specific provider account; combine BYOK with Only use this BYOK.
- You need more concurrency; add API keys from several different accounts under one BYOK.

## How the two sources work together

- **Same model ID**: clients do not need to tell the sources apart. Once a BYOK configuration takes effect, the model automatically gains a BYOK source in the model marketplace and is enabled by default; you can switch each source on or off under Providers & pricing on the model detail page.
- **BYOK first within a channel**: BYOK for a built-in provider shares that provider's channel with the platform source. When the gateway enters a channel, it tries your BYOK credentials in the order you set, then platform credentials. A custom provider is a separate channel and is sorted with the other channels by the multi-channel routing strategy; see [Channels and routing](https://platform.lyrouter.com/ai_gateway/docs/routing/en).
- **Pinning BYOK**: turn on Prefer this Channel in the Usage step of BYOK so the selected models try this channel first. Turning on Only use this BYOK stops the use of platform credentials, other channels and the default model, and the channel's platform source shows BYOK only in the model marketplace.
- **A balance is still required**: before a BYOK call, the gateway reserves the service fee from your balance. When the balance is too low it returns 402 `insufficient credit balance` and does not switch to a platform source; see [BYOK fees and credentials](https://platform.lyrouter.com/ai_gateway/docs/byok-cost/en).

## Getting started with BYOK

1. Get an API key from the provider. If the provider offers both a pay-as-you-go API and a Coding Plan, first decide which one to connect; see [API services and Coding Plans](https://platform.lyrouter.com/ai_gateway/docs/coding-plan/en).
2. The current Account Owner connects it on the workspace's **BYOK** page; the steps are in [Connect a provider](https://platform.lyrouter.com/ai_gateway/docs/byok/en). Account Members do not see this page, but they can call the BYOK sources the Owner has configured with their own API keys.
3. A custom provider needs its upstream models mapped to system models; see [Model mappings and sources](https://platform.lyrouter.com/ai_gateway/docs/mapping/en).

Only API keys issued by the provider can be used. The login session or cookies of a web account cannot serve as BYOK credentials.

(Screenshot: The first step of connecting BYOK: choose the provider and billing mode.)

## FAQ

### A model has both a platform source and BYOK. Which one is used first?

**Answer:** Within the same channel of a built-in provider, BYOK credentials are tried first, then platform credentials; different channels are sorted by the multi-channel routing strategy. To always try BYOK first, turn on Prefer this Channel in BYOK. After a call, check the [request logs](https://platform.lyrouter.com/ai_gateway/docs/logs/en): a call that went through BYOK shows a BYOK tag next to Provider.

### My provider is not in the Official model providers list. How do I connect it?

**Answer:** Choose Custom provider and fill in the provider's Base URL and Interface. Providers such as OpenAI and Anthropic are connected this way too. Upstream models must map to text chat models that already exist in the platform model catalog; see [Model mappings and sources](https://platform.lyrouter.com/ai_gateway/docs/mapping/en).

### Can I use BYOK for image generation models?

**Answer:** No. BYOK supports only chat models with text output (they can accept image input). Use platform sources for image, video, audio and embedding models.
