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

# Bring Your Own OpenRouter API Key

> Connect your organisation's OpenRouter account so Ankra's AI runs on your own key - unlimited usage with the same default models and failover.

With your organisation's own OpenRouter API key, Ankra serves the same default models and the same automatic failover chain through **your** OpenRouter account - including background and autonomous AI sessions. Usage on your own key never draws on the [free monthly allowance](/platform/ai-usage), so AI features are never paused by `AI_ALLOWANCE_EXHAUSTED`.

## Prerequisites

* You are an organisation admin with the `ai.manage` permission.
* An OpenRouter account at [openrouter.ai](https://openrouter.ai) with credits available.

## Add the Key

<Steps>
  <Step title="Create an API key at OpenRouter">
    Sign in at [openrouter.ai](https://openrouter.ai) and create a new API key from the **Keys** page. Copy the key - it starts with `sk-or-`.

    <Tip>
      Set a credit limit on the key in OpenRouter. It caps what Ankra can spend through it, independently of Ankra's own [daily spend cap](/platform/ai-usage#daily-spend-cap-vs-monthly-allowance).
    </Tip>
  </Step>

  <Step title="Open the AI provider settings in Ankra">
    Go to **AI** → **Settings** → **Models**.
  </Step>

  <Step title="Save the key">
    In the **OpenRouter** card, paste the `sk-or-...` key and save. Ankra validates the key live against OpenRouter before storing it. Two errors can come back:

    * **Invalid key** - the key was rejected by OpenRouter. Check you copied the full key and that it has not been revoked.
    * **No remaining credits** - the key is valid but its OpenRouter account has no credits left. Top up at OpenRouter, then save again.
  </Step>

  <Step title="Activate the provider">
    Select **OpenRouter** in the provider picker. From this point all AI usage - interactive and background - is billed to your OpenRouter account.
  </Step>

  <Step title="Verify">
    The card now shows a masked preview of the stored key (for example `sk-or-...wxyz`). Open the AI Assistant (`⌘+J` / `Ctrl+J`) and send a message - the response confirms the provider is serving requests, and the run appears in your OpenRouter activity.
  </Step>
</Steps>

## Rotating the Key

Save a new key over the old one in the same **OpenRouter** card. The new key goes through the same live validation, and the old one is replaced on save - no downtime and no provider switch needed.

## Removing the Key

Deleting the key switches the organisation back to the Ankra-managed provider, and the [free monthly allowance](/platform/ai-usage) rules apply again. If the allowance is already exhausted for the month, AI features pause until it resets or you add a key again.

## Security

* The key is stored **only in Vault** - never in the database.
* It is never shown again after saving; the UI only ever displays a masked preview like `sk-or-...wxyz`.
* Viewing the preview, saving, and removing the key all require the `ai.manage` permission.
* The key is never included in exports.

## Related Pages

* [AI Usage & Free Allowance](/platform/ai-usage) - what the allowance covers and what happens when it runs out
* [AI Provider](/platform/ai-provider) - all provider modes, including Anthropic and OpenAI-compatible endpoints
