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

# Keep LLM API Keys Out of Your AI Agents

> Store Anthropic, OpenAI, and other LLM API keys in Buckle and let the gateway inject them, so agents call models without ever seeing the raw key.

## Overview

Store your LLM API keys in Buckle and the gateway injects them into requests automatically. Agents call model APIs without ever seeing the raw key.

![The LLMs tab under Settings > Apps in the Buckle dashboard](https://mintcdn.com/onecli-17d3f772/hJP3XqgFsBDnXHKy/images/connections-llms.png?fit=max\&auto=format\&n=hJP3XqgFsBDnXHKy\&q=85\&s=7d2ef64bd5d9e61e3b420612929b4e78)

| Provider | Target host | Auth method |
| - | - | - |
| [Anthropic](/docs/integrations/anthropic.md) | `api.anthropic.com` | API key or OAuth token |
| [OpenAI](/docs/integrations/openai.md) | `api.openai.com` (API key) or `chatgpt.com` (Codex OAuth) | API key or Codex OAuth (ChatGPT login) |

## What you will set up

* An LLM key for each provider you use, stored encrypted in Buckle
* Automatic injection into the right header for each provider host
* Per-agent access to each key, with optional rules

## How it works

1. You add an API key in the Buckle dashboard under **Settings** > **Apps** > **LLMs**
2. Buckle encrypts and stores the key (AES-256-GCM at rest)
3. When an agent sends a request to a matching host (e.g. `api.anthropic.com`), the gateway injects the key into the appropriate header
4. The request is forwarded to the provider

If you rotate a key, update it in the dashboard and all agents pick up the new key automatically.

## Controlling access

Access is per agent: [attach](/docs/guides/agent-access.md) the key to each agent that needs it — an agent without the grant can't use it at all. Organization [rules](/docs/guides/rules.md) add guardrails on top: rate-limit requests, restrict agents to specific models by blocking certain paths, or flag high-cost operations for manual approval. Everything is checked before credential injection, so a blocked request never reaches the provider.

## FAQ

> [accordion] How do I rotate an LLM API key?
>
> Create a new key with the provider, then update it in the Buckle dashboard. All agents pick up the new key automatically.

> [accordion] How do I keep LLM keys out of the agent's context?
>
> Store them in Buckle instead of `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`. The gateway injects the key at the proxy, so the agent never holds it. See [How it works](/docs/how-it-works.md).

> [accordion] Can I use a Claude or ChatGPT subscription instead of an API key?
>
> Yes. Anthropic accepts a token from `claude setup-token`, and OpenAI accepts Codex OAuth credentials. See [Anthropic](/docs/integrations/anthropic.md) and [OpenAI](/docs/integrations/openai.md).

> [accordion] How do I get started?
>
> Follow the [quickstart](/docs/quickstart.md), then add a key under **Settings** > **Apps** > **LLMs** and [attach](/docs/guides/agent-access.md) it to an agent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.