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

# Bring your own key

> Connect your own OpenRouter key and a Google AI Platform key so Erlin runs AI scans and content generation on your account instead of consuming credits.

BYOK plans let you connect your own provider keys so Erlin runs AI operations on your account instead of spending Erlin credits. There are two key slots. An OpenRouter key (required) powers ChatGPT, Perplexity, Gemini, and Claude. A Google AI Platform key (optional) powers Google AI Overview and AI Mode, using either SerpApi or DataForSEO. Erlin handles the routing: you keep the same dashboards, metrics, and content tools, and the calls go through your keys.

## The two key slots

Erlin uses two key slots because chat models and Google search features run on different providers.

**OpenRouter (required).** One OpenRouter key covers all four chat platforms: ChatGPT, Perplexity, Gemini, and Claude, with web search enabled. With it connected, prompt executions and content generation are unlimited and consume no Erlin credits. You pay OpenRouter directly from your account balance. On a BYOK plan, AI queries do not run until an OpenRouter key is connected.

**Google AI Platform key (optional).** This slot covers Google AI Overview and AI Mode, which are Google search features rather than chat models. Connect either a SerpApi key or a DataForSEO credential, whichever you already use. Erlin only needs one provider: with either connected, AI Overview and AI Mode run on your key and cost no credits. Without one, each execution costs 2 credits and runs on Erlin's backend key.

## What BYOK gives you

With an OpenRouter key connected:

* Unlimited prompt executions across ChatGPT, Perplexity, Gemini, and Claude
* Unlimited content generation (articles, products, collections)
* No credit limits or feature caps on those operations
* Costs you control through your OpenRouter account balance

Add a SerpApi or DataForSEO key on top and AI Overview and AI Mode stop drawing the 2-credit charge per execution.

## Before you start

Three things, two of them required:

1. **A BYOK plan.** Check your plan name in **Settings > Accounts > Usage & Billing**. If it does not include "BYOK," upgrade from the pricing page. The **API Keys** tab only appears on BYOK plans.
2. **An OpenRouter API key.** Create one at [openrouter.ai/keys](https://openrouter.ai/keys). Keys start with `sk-or-v1-`.
3. **A SerpApi or DataForSEO key (optional).** Create a SerpApi key at [serpapi.com/manage-api-key](https://serpapi.com/manage-api-key), or DataForSEO credentials at [dataforseo.com](https://dataforseo.com), if you want AI Overview and AI Mode to run credit-free. You only need one.

## Add your OpenRouter key

<Steps>
  <Step title="Open the API Keys tab">
    Go to **Settings > Accounts** and select the **API Keys** tab. Erlin shows a row for OpenRouter and a row for the Google AI Platform key.
  </Step>

  <Step title="Start the OpenRouter row">
    In the OpenRouter row, click **Add OpenRouter Key**.
  </Step>

  <Step title="Paste your key">
    Enter your OpenRouter API key. Keys start with `sk-or-v1-`. Get yours at [openrouter.ai/keys](https://openrouter.ai/keys).
  </Step>

  <Step title="Save and validate">
    Click **Save Key**. Erlin tests the key against OpenRouter before storing it. If validation passes, the key is encrypted, saved, and marked **Active**. All AI queries across the four chat platforms now run through it.
  </Step>
</Steps>

## Add your Google AI Platform key

This key is optional. Add it to run AI Overview and AI Mode without spending credits. Choose SerpApi or DataForSEO: Erlin only needs one, and if you connect both, Erlin uses SerpApi and ignores the DataForSEO key.

<Steps>
  <Step title="Open the Google AI Platform row">
    In the **API Keys** tab, find the Google AI Platform row and choose **SerpApi** or **DataForSEO**.
  </Step>

  <Step title="Enter your credentials">
    For SerpApi, paste your API key. Get yours at [serpapi.com/manage-api-key](https://serpapi.com/manage-api-key).

    For DataForSEO, choose Login + Password or Base64 Key. Login + Password takes the API login and API password from your DataForSEO dashboard directly: these are different from your DataForSEO account login. Base64 Key takes a single pre-encoded `login:password` string if you already have one. Get your credentials at [dataforseo.com](https://dataforseo.com).
  </Step>

  <Step title="Save and validate">
    Click **Save Key**. Erlin checks the credential against the provider's account API, which confirms it works without spending a search credit. Once it is **Active**, AI Overview and AI Mode executions run on your key at no credit cost.
  </Step>
</Steps>

## Where to get your keys

**OpenRouter:**

1. Go to [openrouter.ai/keys](https://openrouter.ai/keys)
2. Create an OpenRouter account if you do not have one
3. Click Create Key and copy it (it starts with `sk-or-v1-`)
4. Add funds to your OpenRouter balance: Erlin draws on this balance for API calls

**SerpApi:**

1. Go to [serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)
2. Create a SerpApi account if you do not have one
3. Copy your API key
4. Confirm your SerpApi plan has searches remaining: AI Overview and AI Mode draw on your SerpApi search quota

**DataForSEO:**

1. Go to [dataforseo.com](https://dataforseo.com) and sign in to your account
2. Open the API Dashboard to find your API login and API password: these are separate from your account login credentials
3. Copy your API login and API password, or combine them yourself as `login:password` and base64-encode the result if you want to paste a single key
4. Confirm your DataForSEO account has balance: AI Overview and AI Mode draw on it per execution

## How your keys are stored

Erlin encrypts every key before it reaches the database, and the raw value is never logged. After you save a key, the dashboard only shows a masked hint, never the full key. For OpenRouter and SerpApi the hint is the last few characters of your key. For DataForSEO the hint is your API login, since a base64-encoded credential has no readable characters to show. Erlin decrypts a key at runtime only to make API calls on your behalf.

## Monitoring usage and balance

Once a key is active, Erlin shows its usage right in the API Keys tab.

**OpenRouter balance** appears in the OpenRouter row, fetched live from OpenRouter. A low-balance alert turns the balance red when your funds drop below \$5. Top up directly at [openrouter.ai](https://openrouter.ai) to keep operations running.

**SerpApi usage** appears in the Google AI Platform row when SerpApi is your connected provider: searches remaining out of your monthly quota, searches used this month, and your SerpApi plan name. Top up or upgrade at [serpapi.com](https://serpapi.com) when you run low.

**DataForSEO** does not show a running usage count in the row. Erlin confirms the credential works and reports your account balance at the moment you save the key. Check your live balance and usage at [dataforseo.com](https://dataforseo.com).

## Managing your keys

Each key row has two controls when you own the account:

* **Re-validate** (OpenRouter and SerpApi) or **Test Connection** (DataForSEO) re-checks the key against the provider and refreshes its status. Use it after topping up or if a key starts failing.
* **Remove** deletes the key. Removing your OpenRouter key stops AI queries on a BYOK plan until you add a new one. Removing your Google AI Platform key sends AI Overview and AI Mode back to the 2-credit-per-execution charge on Erlin's backend key.

If both SerpApi and DataForSEO are saved, the row shows SerpApi as active and flags the DataForSEO key as unused, with a one-click option to remove it.

A status badge sits next to each key: **Active**, **Invalid**, **Expired**, **Needs Attention**, or **No Credits**. Anything other than Active means Erlin could not use the key on the last attempt. Re-validate after fixing the issue at the provider.

## For team members

If you are a sub-user or sub-account on a BYOK plan, the keys are managed by your account owner or agency. Once they add a key, it applies to your usage automatically, and you see a read-only view in the API Keys tab. You cannot add, change, or remove keys yourself. If no key is set yet, the tab tells you to contact your administrator.

## Related

<CardGroup cols={2}>
  <Card title="Plans and usage" icon="credit-card" href="/account/plans-and-usage">
    View your balance and understand how credits work alongside BYOK.
  </Card>

  <Card title="Team and account" icon="user" href="/account/team-and-account">
    Manage team members who share your BYOK keys.
  </Card>
</CardGroup>
