---
agent:
  instructions: "Search the site by keyword or question. The search API returns Markdown."
  endpoint: "https://platform.invideo.io/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Provider keys (BYOK)

> Run models on your own provider accounts, what invideo charges, what happens when your key fails, and how a request asks for it.

A workspace can add its own API keys for the providers behind our models. A request for a model of such a provider then runs on **your account at that provider**. Your provider bills you for the run, and invideo charges only a small fee instead of the model's price.

[Provider keys (BYOK)](/manage/provider-keys) is available per workspace. Contact invideo to request access.

## Add a key

Owners and admins can add keys under [Provider keys (BYOK)](/manage/provider-keys). invideo encrypts the key and the console shows its last four characters.

Before saving a key, the console sends one small request to the provider. If the test passes, the key is **Active**. If it fails, the console shows why and what to do next. Choose **Save anyway** to keep the key marked **Not accepted** until it passes a test. To retry, choose **Test key** in the key’s menu.

Turn a key off to go back to invideo's key and the normal prices; delete it to erase it. A change reaches every request within about a minute.

| Provider | The key |
| --- | --- |
| fal, OpenAI, Anthropic, xAI, ElevenLabs, MiniMax, Kling, BytePlus, Ideogram, Alibaba Cloud, PixVerse, Luma, Runway, Black Forest Labs, Cartesia, OpenRouter | An API key |
| Google Vertex | A service account key (JSON) for a project where Vertex AI is on. Gemini chat and the Google media models run in that project. |
| Amazon Bedrock | No key: an IAM role in your AWS account that trusts invideo for the external id the console shows, and its ARN |

`GET /v1/models` names the provider a model needs (`byok_provider`) and whether your workspace has a working key for it (`byok_active`). Your provider's own terms, limits and data retention apply to runs on your key.

## What invideo charges

A request on your key costs invideo's fee, never the list price. Unless invideo set another fee for your workspace, it is **5% of the model's list price**, worked out exactly like the price you would have paid. A request that fails is free. Your Spend page and the request's `cost_usd` show the fee only.

## Which requests use your key

By default every request for a model of a provider you have a working key for. In the console you can change this to *only requests that ask for it*, for the whole workspace, one provider or one model. One request can always decide for itself:

- the JSON body of a media request takes `"byok": true` (or `false`);
- every call, chat included, takes the header `X-Invideo-Byok: 1` (or `0`).

A request that asks for your key and cannot have it fails with `422 byok_no_key`. The answer to a media request has the header `X-Invideo-Byok: true` when it runs on your key, and `GET /v1/request/{id}` has `"byok": true`.

## When your key fails

These BYOK errors identify a problem with your key or provider account.

| Code | Meaning |
| --- | --- |
| `byok_credential_rejected` | The provider did not accept your key. Three refusals in a row turn the key to Not accepted. |
| `byok_provider_forbidden` | Your provider account knows the key but refused this request, usually because it has no access to the model. The key is not turned off for this. |
| `byok_provider_quota` | Your provider account has no credit or quota left. |
| `byok_provider_rate_limited` | Your provider account hit its rate limit. Retry in a moment. |
| `byok_credential_unavailable` | The key could not be loaded. Check it in the console. |

Set the key failure policy under **If your key fails** in the console. You can set it for the workspace, a provider, a model, or a single request with `X-Invideo-Byok-Fallback: invideo`.
