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

# Using the LLM Gateway

> Send LLM traffic from Cursor, Claude Code, your apps, and the OpenAI / Anthropic SDKs through the Barndoor LLM Gateway.

## Overview

The Barndoor **LLM Gateway** is a proxy that sits between your AI tools and one or more upstream LLM providers (OpenAI, Anthropic, Azure OpenAI, AWS Bedrock, Google Vertex AI, and many more). It speaks both the **OpenAI Chat Completions / Responses / Embeddings** APIs and the **Anthropic Messages** API natively, so most clients — including OpenAI's and Anthropic's SDKs, Cursor, Claude Code, LangChain, and similar tools — work simply by pointing their base URL at Barndoor.

Pointing your client at the gateway gives you a single endpoint that:

* **Centralizes provider credentials** — provider API keys stay in Barndoor, never on developer machines.
* **Enforces governance** — rate limits, token budgets, and per-user / per-team model access policies.
* **Routes intelligently** — model routes, multi-provider failover, and automatic retries on transient 429s.
* **Records usage** — per-request token, cost, and latency telemetry surfaced in the Barndoor portal.

<Info>
  Anything that speaks the OpenAI Chat Completions / Embeddings / Responses API can use the gateway by setting `base_url`. Clients that prefer Anthropic's Messages API (for example **Claude Code**) can talk to the gateway directly as well.
</Info>

## Architecture at a Glance

```mermaid theme={null}
flowchart TB
    Client["Your client<br/>Cursor • Claude Code • SDK • curl"]
    Client -- "Bearer bd-…<br/>OpenAI / Anthropic JSON" --> Gateway

    subgraph Gateway["Barndoor LLM Gateway"]
        direction TB
        Auth["API-key auth"]
        Access["Model access policies"]
        Limits["Rate limits &amp; budgets"]
        Routing["Routing, retry &amp; failover"]
    end

    Gateway --> OpenAI[OpenAI]
    Gateway --> Anthropic[Anthropic]
    Gateway --> Azure[Azure OpenAI]
    Gateway --> Bedrock[AWS Bedrock]
    Gateway --> Vertex[Google Vertex AI]
    Gateway --> Other["…and other<br/>supported providers"]
```

## Before You Begin

You'll need:

* A Barndoor account with access to the **LLM Management** area (admin) and/or the **My Models** settings page (any user).
* The base URL of your Barndoor portal. Throughout this guide we use `https://app.barndoor.ai` (the Barndoor SaaS host). The authoritative value for your tenant is shown in the **LLM Gateway Endpoint** card on **Settings → My Models** — copy it from there.
* For **admins** setting up the gateway for the first time: an upstream provider account (OpenAI, Anthropic, etc.) and credentials for it.

<Note>
  The LLM Gateway is being rolled out per tenant. If you don't see the **LLM Management** or **My Models** menu items, contact your Barndoor admin or [support@barndoor.ai](mailto:support@barndoor.ai) to have it enabled for your organization.
</Note>

<Info>
  **Self-hosted and private-cloud deployments:** if Barndoor is running on your own infrastructure, swap `app.barndoor.ai` for your organization's portal hostname everywhere in this guide. The path (`/api/llm-gateway/v1`) is the same.
</Info>

## Next Steps

Ready to set up the gateway and send your first request? Continue to the **[Quickstart Guide](/how-tos/llm-gateway-quickstart)**, which covers:

* A two-minute quickstart (get a key, find your endpoint, send a request).
* Admin configuration — credentials, providers, models, pricing, and model routes.
* Connecting your tools — Cursor, Claude Code, and the OpenAI/Anthropic SDKs.
* Sending requests, observability headers, failover, troubleshooting, and FAQ.
