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

# Bring Your Own Key

> Connect your own AI provider API key so Garth uses your account for all review and scan requests.

Garth supports **Bring Your Own Key (BYOK)**, which lets you supply your own API key from an AI provider instead of relying on Garth's shared capacity. All keys are encrypted and stored in Garth's secure vault — they are never logged or exposed in plain text.

## Why use BYOK?

<Columns cols={1}>
  <Card title="Your own rate limits" horizontal icon="gauge-high">
    Reviews and scans draw from your provider account's quota, so high-volume teams are never throttled by shared limits.
  </Card>

  <Card title="Data residency control" horizontal icon="shield-halved">
    Requests go directly from Garth to your provider under your account, giving you full control over which region processes your code.
  </Card>

  <Card title="Cost visibility" horizontal icon="receipt">
    All token usage is billed to your provider account so you can track AI spend alongside your other developer tooling.
  </Card>
</Columns>

## Supported providers

<Columns cols={2}>
  <Card title="Claude" icon="sparkles" href="/byok/claude-tiers">
    Recommended. Best-in-class reasoning for code review and security analysis.
  </Card>

  <Card title="OpenAI" icon="robot" href="/byok/openai-models">
    GPT-4o and GPT-4 Turbo models supported.
  </Card>

  <Card title="Gemini" icon="google" href="/byok/gemini-models">
    Gemini 1.5 Pro and Gemini 2.0 Flash supported.
  </Card>

  <Card title="Sarvam AI" icon="https://assets.sarvam.ai/assets/brand/logos/sarvam-logo-white.svg" href="/byok/sarvam-ai">
    Sarvam-105B and Sarvam-M models optimized for Indian languages.
  </Card>
</Columns>

<Tip>
  Claude is the default and recommended provider. It consistently produces the most accurate inline review comments and security findings across the codebases Garth has been tested on.
</Tip>

***

## Adding your API key

All keys are stored in the **Garth Secure Vault** — encrypted at rest, never written to logs, and scoped to your organisation only.

<Steps>
  <Step title="Open the Integrations settings">
    Navigate to [**Settings → Integrations → LLM**](https://app.heygarth.ai/settings/integrations) in the Garth dashboard.
  </Step>

  <Step title="Select a provider">
    Choose **Claude**, **OpenAI**, **Gemini**, or **Sarvam AI** from the provider list.
  </Step>

  <Step title="Paste your API key">
    Enter your API key in the input field. The key is immediately encrypted before it leaves your browser.
  </Step>

  <Step title="Save to vault">
    Click **Save**. Garth validates the key against the provider's API, then stores it in the secure vault. A masked preview (e.g. `sk-ant-••••••••XXXX`) confirms the key is saved.
  </Step>

  <Step title="Set as active provider">
    If you have keys for more than one provider, select which provider Garth should use for new requests under **Active Provider**.
  </Step>
</Steps>

<Warning>
  You can only have one active provider at a time. Switching providers does not delete existing keys — stored keys remain in the vault until you explicitly remove them.
</Warning>

***

## Provider reference

### Claude (Anthropic)

Get your API key from the [Anthropic Console](https://console.anthropic.com/settings/keys).

| Setting               | Value                                                                    |
| --------------------- | ------------------------------------------------------------------------ |
| **Key format**        | `sk-ant-api03-…`                                                         |
| **Recommended model** | `claude-sonnet-4-6` or `claude-haiku-4-5` (faster, lower cost)           |
| **Rate limits**       | Depend on your usage tier — see [Claude tier limits](/byok/claude-tiers) |

### OpenAI

Get your API key from the [OpenAI Platform](https://platform.openai.com/api-keys).

| Setting               | Value                                                                                 |
| --------------------- | ------------------------------------------------------------------------------------- |
| **Key format**        | `sk-proj-…` or `sk-…`                                                                 |
| **Recommended model** | `gpt-4o`                                                                              |
| **Rate limits**       | Depend on your OpenAI usage tier — see [OpenAI models and tiers](/byok/openai-models) |

### Gemini (Google AI)

Get your API key from [Google AI Studio](https://aistudio.google.com/app/apikey).

| Setting               | Value                                                                                                |
| --------------------- | ---------------------------------------------------------------------------------------------------- |
| **Key format**        | `AIza…`                                                                                              |
| **Recommended model** | `gemini-1.5-pro` or `gemini-2.0-flash`                                                               |
| **Rate limits**       | Depend on your Google Cloud project quota — see [Gemini models and rate limits](/byok/gemini-models) |

### Sarvam AI

Get your API key from the [Sarvam AI Dashboard](https://dashboard.sarvam.ai/).

| Setting               | Value                                                                                     |
| --------------------- | ----------------------------------------------------------------------------------------- |
| **Key format**        | Alphanumeric string passed as `api-subscription-key`                                      |
| **Recommended model** | `sarvam-105b` (complex reasoning) or `sarvam-m` (faster, lower cost)                      |
| **Rate limits**       | Depend on your Sarvam AI subscription tier — see [Sarvam AI rate limits](/byok/sarvam-ai) |

***

## Removing a key

To remove a stored key, go to [**Settings → Integrations → LLM**](https://app.heygarth.ai/settings/integrations), find the provider, and click **Disconnect**. The key is permanently deleted from the vault and cannot be recovered.

<Note>
  Removing an active key will pause all AI-powered reviews and scans until a new key is added or the provider is switched.
</Note>

***

## Next steps

<Columns cols={2}>
  <Card title="Claude tier limits" icon="layer-group" href="/byok/claude-tiers">
    Understand Claude API usage tiers and choose the right tier for your team's volume.
  </Card>

  <Card title="OpenAI models and tiers" icon="robot" href="/byok/openai-models">
    Understand OpenAI's usage tiers and choose the right GPT model for your team's volume.
  </Card>

  <Card title="Gemini models and rate limits" icon="google" href="/byok/gemini-models">
    Understand Gemini's free and pay-as-you-go tiers and model options.
  </Card>

  <Card title="Sarvam AI rate limits" icon="https://assets.sarvam.ai/assets/brand/logos/sarvam-logo-white.svg" href="/byok/sarvam-ai">
    Understand Sarvam AI subscription tiers and models optimized for Indian-language codebases.
  </Card>

  <Card title="Customize review" icon="pen-to-square" href="/pull-request-review/customize-review">
    Write custom instructions to align Garth's reviews with your team's standards.
  </Card>
</Columns>
