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

# Bring Your Own Keys (BYOK)

> Use your own provider API keys with Anannas for enhanced control over rate limits and billing.

With BYOK, you can route requests through your own provider accounts while still using Anannas as your unified gateway. This gives you direct visibility into provider-level usage and billing while letting Anannas handle the routing complexity.

Your keys are encrypted at rest and only used for requests to their respective providers. Anannas credits remain available as a fallback when your provider keys encounter issues; unless you choose otherwise.

Configure and manage your provider keys in [account settings](https://anannas.ai/dashboard/byok).

<Note>
  You can add multiple provider keys and toggle them on/off anytime. When a key is disabled, it won't be used for routing.
</Note>

## Getting started

<Steps>
  <Step title="Open Integrations (BYOK)">
    Navigate to the Integrations (BYOK) section in your dashboard sidebar.
  </Step>

  <Step title="Choose a provider">
    Select from the available providers.
  </Step>

  <Step title="Add your key">
    Click "Add key" and fill in the popup with Name and Key.
  </Step>

  <Step title="Configure options">
    Toggle "Enabled" to activate routing; optionally enable "Always use this key" to disable fallback.
  </Step>

  <Step title="Save">
    Save your configuration.
  </Step>
</Steps>

<Tip>
  Need help getting started with Anannas? Check the [QuickStart](/quickstart) guide for client setup and examples.
</Tip>

## Supported providers

<Tabs>
  <Tab title="Anthropic">
    In the Add key popup, provide:

    * **Name** — identifier for your key
    * **Key** — your Anthropic API key
    * **Enabled** — activate routing via your account
    * **Always use this key** — disable fallback to Anannas credits

    You can obtain your API key from your Anthropic account. See [Anthropic's docs](https://docs.anthropic.com/claude/reference/getting-started-with-the-api) for more info.
  </Tab>

  <Tab title="xAI (Grok)">
    In the Add key popup, provide:

    * **Name** — identifier for your key
    * **Key** — your xAI API key
    * **Enabled** — activate routing via your account
    * **Always use this key** — disable fallback to Anannas credits

    You can obtain your API key from your xAI account. Check out [xAI's docs](https://docs.x.ai/) for more info.
  </Tab>

  <Tab title="Nebius">
    In the Add key popup, provide:

    * **Name** — identifier for your key
    * **Key** — your Nebius API key
    * **Enabled** — activate routing via your account
    * **Always use this key** — disable fallback to Anannas credits

    You can obtain your API key from your Nebius account. See [Nebius docs](https://nebius.com/docs/) for more info.
  </Tab>
</Tabs>

<Info>
  We're actively expanding provider support. Want your provider listed? Reach out — we're happy to integrate.
</Info>

## Key priority and fallback

Anannas prioritizes your provider key when present and Enabled. If your key hits a rate limit or errors, we fall back to Anannas credits so your calls keep flowing.

Turn on "Always use this key" to disable fallback. With that enabled, we'll only use your key; you may see rate limit errors if your provider rejects the request.

## Pricing

<Card title="Check BYOK Pricing" icon="book">
  For current BYOK pricing and provider/model rates, visit [anannas.ai/models](https://anannas.ai/models).
</Card>

<Warning>
  BYOK usage is billed at 5% of the underlying provider/model price, waived for the first 1M BYOK requests per month.

  Your provider still bills usage directly when your key is used; the 5% BYOK fee is separate and applies on the Anannas side.
</Warning>

## Using BYOK in clients

No code changes are required in your client — routing uses your configured keys automatically.

<CodeGroup>
  ```python python theme={null}
  from openai import OpenAI

  client = OpenAI(
    base_url="https://api.anannas.ai/v1",
    api_key="<ANANNAS_API_KEY>",
  )

  resp = client.chat.completions.create(
    model="anthropic/claude-3.7-sonnet",
    messages=[{"role": "user", "content": "Hello from Anannas!"}],
  )
  print(resp.choices[0].message.content)
  ```

  ```typescript typescript theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://api.anannas.ai/v1",
    apiKey: "<ANANNAS_API_KEY>",
  });

  const resp = await client.chat.completions.create({
    model: "openai/gpt-5-mini",
    messages: [{ role: "user", content: "Hello from Anannas!" }],
  });
  console.log(resp.choices[0].message.content);
  ```
</CodeGroup>

### When to enable "Always use this key"

Enable this option if you need strict guarantees that all requests go through your provider account (for auditing, compliance, or budget tracking). If disabled, Anannas falls back to platform credits when your key hits errors or limits; keeping your app running smoothly.

<div
  style={{ 
marginTop: '2rem',
display: 'flex',
alignItems: 'center',
gap: '0.75rem',
fontSize: '14px',
color: '#6b7280'
}}
>
  <span>Was this page helpful?</span>

  <button
    id="feedback-yes-btn"
    onClick={() => {
  console.log('Positive feedback');
  document.getElementById('feedback-yes-btn').style.background = 'rgba(156, 163, 175, 0.1)';
  document.getElementById('feedback-yes-btn').style.backdropFilter = 'blur(10px)';
  document.getElementById('feedback-yes-btn').style.border = '1px solid rgba(156, 163, 175, 0.2)';
  document.getElementById('feedback-no-btn').style.background = 'transparent';
  document.getElementById('feedback-no-btn').style.backdropFilter = 'none';
  document.getElementById('feedback-no-btn').style.border = 'none';
}}
    style={{
  background: 'transparent',
  border: 'none',
  cursor: 'pointer',
  padding: '6px 12px',
  fontSize: '14px',
  borderRadius: '8px',
  transition: 'all 0.2s ease',
  display: 'flex',
  alignItems: 'center',
  gap: '6px',
  color: '#6b7280'
}}
  >
    <span style={{ fontSize: '16px' }}>👍</span>
    Yes
  </button>

  <button
    id="feedback-no-btn"
    onClick={() => {
  console.log('Negative feedback');
  document.getElementById('feedback-no-btn').style.background = 'rgba(156, 163, 175, 0.1)';
  document.getElementById('feedback-no-btn').style.backdropFilter = 'blur(10px)';
  document.getElementById('feedback-no-btn').style.border = '1px solid rgba(156, 163, 175, 0.2)';
  document.getElementById('feedback-yes-btn').style.background = 'transparent';
  document.getElementById('feedback-yes-btn').style.backdropFilter = 'none';
  document.getElementById('feedback-yes-btn').style.border = 'none';
}}
    style={{
  background: 'transparent',
  border: 'none',
  cursor: 'pointer',
  padding: '6px 12px',
  fontSize: '14px',
  borderRadius: '8px',
  transition: 'all 0.2s ease',
  display: 'flex',
  alignItems: 'center',
  gap: '6px',
  color: '#6b7280'
}}
  >
    <span style={{ fontSize: '16px' }}>👎</span>
    No
  </button>
</div>
