---
description: What is an LLM proxy? A server that forwards LLM API calls through one endpoint. Learn how it works, common uses, its limits, and when teams need an AI gateway.
title: What Is an LLM Proxy? How It Works and Where It Stops
image: https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/11/what-is-an-llm-proxy-how-it-works-and-where-it-stops-bifrost-1920x1080.png
---

Try Bifrost Enterprise free for 14 days. [Request access](https://www.getmaxim.ai/#enterprise-trial)

**TL;DR**

- An LLM proxy is a server between applications and model providers that forwards requests through one endpoint and holds the provider API keys.
- A typical LLM proxy swaps credentials, translates request formats, forwards to the provider, retries failures, and logs tokens and latency.
- Teams use LLM proxies to hide provider keys, switch providers without code changes, and see usage in one place.
- An LLM proxy usually stops short of governance: per-team budgets, identity, guardrails, audit logs, and MCP tool control are not part of the basic pattern.
- An AI gateway such as Bifrost includes proxy functions and adds governance, adding about 11 microseconds of overhead per request at 5,000 RPS.

An LLM proxy is usually the first piece of infrastructure a team adds once more than one application calls a model API: one endpoint, one place for keys, one log. [Bifrost](https://www.getmaxim.ai/), the [open-source AI gateway that covers proxy functions and governance](https://github.com/maximhq/bifrost), built by Maxim AI, starts from the same pattern and adds the controls teams reach for once usage grows. This guide explains what an LLM proxy is, how it handles a request, what it is used for, and where its responsibilities end and an [AI gateway's](https://www.getmaxim.ai/llm-gateway) begin.

## What Is an LLM Proxy?

An LLM proxy is a server that sits between applications and large language model providers, receives model API requests at one endpoint, and forwards each request to a provider using credentials the proxy holds. It is also called an LLM API proxy or AI proxy.

The defining property is indirection. Applications point their SDK's base URL at the proxy instead of at OpenAI, Anthropic, or a self-hosted model server, and authenticate with a proxy credential instead of a provider key. The proxy decides which provider receives the request, as Figure 1 shows.

![](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2026/11/what-is-an-llm-proxy-vs-gateway-layers.svg)

*Figure 1: Applications integrate once with the proxy instead of once per provider.*

Most LLM proxies expose an [OpenAI-compatible API](https://www.getmaxim.ai/topics/openai-compatible-api), because that request format is supported by the largest number of SDKs and tools. Our explainer on the [LLM gateway category](https://www.getmaxim.ai/topics/llm-gateway) covers how the proxy pattern grew into the gateway category.

## How an LLM Proxy Works

An LLM proxy handles each request in a short pipeline: it accepts the application's credential, swaps in a provider credential, translates the request into the provider's format if needed, forwards it, retries on transient failure, and logs the result before returning the response.

![](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2026/11/what-is-an-llm-proxy-request-steps.png)

*Figure 2: A basic proxy forwards and translates; it does not decide who is allowed to spend what.*

Each step in Figure 2 solves a specific problem:

- **Credential swap:** applications never see provider keys, so a leaked application config exposes only a proxy credential.
- **Translation:** one request format reaches providers with different APIs, such as OpenAI's Chat Completions and Anthropic's Messages.
- **Forwarding:** the proxy chooses a provider from the model name or a configured mapping.
- **Retry:** transient 5xx errors and 429 rate limits are retried, sometimes on a second key.
- **Logging:** tokens, latency, and status are recorded for each request.

Streaming responses pass through the proxy as server-sent events, so the proxy must forward chunks as they arrive rather than buffering the full response. That requirement is why proxy overhead matters: every millisecond the proxy adds is added to time to first token. Bifrost publishes its [gateway benchmarks](https://www.getmaxim.ai/resources/benchmarks) for this reason.

## What an LLM Proxy Is Used For

Teams adopt an LLM proxy to remove provider-specific plumbing from application code. The common uses fall into five groups:

- **Key isolation:** provider keys live on one server instead of in every service and laptop.
- **Provider switching:** changing a model or provider is a proxy configuration change, not a code change.
- **Local and self-hosted models:** the same endpoint reaches hosted APIs and models served by vLLM or Ollama.
- **Usage visibility:** one log shows which models are used and how many tokens they consume.
- **Failure handling:** retries and simple fallbacks reduce the impact of provider errors.

Coding agents are a newer use. Tools such as Claude Code and Codex CLI accept a custom base URL, and Anthropic's documentation on [running Claude Code behind an LLM gateway](https://code.claude.com/docs/en/llm-gateway) lists centralized credentials, usage tracking, and provider switching as the reasons to do so. Our guide to [MCP proxy servers](https://www.getmaxim.ai/articles/mcp-proxy-server-explained-architecture-and-use-cases/) covers the equivalent pattern for tool calls.

## Types of LLM Proxies

LLM proxies differ mainly in where they run and who shares them. The deployment choice decides who operates the proxy, where prompts travel, and how many applications depend on it.

| Type | Where it runs | Typical use | Main trade-off |
| --- | --- | --- | --- |
| Sidecar or per-app proxy | Next to one service | Key isolation for a single application | No shared view across services |
| Shared self-hosted proxy | In the company's VPC or cluster | One endpoint for many teams | The team operates and scales it |
| Local developer proxy | On a laptop | Pointing a coding agent at other models | No central control or logging |
| Hosted proxy service | In a vendor's cloud | Fast start with no infrastructure | Prompts pass through a third party |

Self-hosted, open source proxies are common because they keep prompts inside the company network and avoid a per-token fee. Our comparison of [open source LLM gateways for self-hosted deployments](https://www.getmaxim.ai/articles/5-best-open-source-llm-gateways-for-self-hosted-deployments-in-2026/) reviews the main options, and the [LLM Gateway Buyer's Guide](https://www.getmaxim.ai/resources/buyers-guide) offers an evaluation checklist.

## Where an LLM Proxy Stops

A basic LLM proxy answers "where does this request go?" It does not answer "who is allowed to send it, how much may they spend, and is the content safe?" Those questions appear as soon as several teams share one endpoint.

The gaps are consistent across organizations:

- **Identity and attribution:** a shared proxy credential cannot say which team or developer made a request.
- **Budgets and rate limits:** without per-caller limits, one runaway job can consume the shared provider quota.
- **Guardrails:** prompts with personal data or secrets pass through unchanged.
- **Audit:** configuration changes to routing or keys leave no record of who made them.
- **Tool traffic:** agents calling [MCP tools](https://docs.getbifrost.ai/mcp/overview) bypass the proxy entirely, so tool access is ungoverned.
- **Availability:** a single proxy instance becomes a single point of failure for every AI feature.

Several risks in the [OWASP Top 10 for LLM Applications](https://owasp.org/www-project-top-10-for-large-language-model-applications/), such as sensitive information disclosure and unbounded consumption, land exactly in these gaps. Closing them is the work an AI gateway does on top of the proxy layer, through controls such as [budgets and rate limits per caller](https://docs.getbifrost.ai/features/governance/budget-and-limits).

## LLM Proxy vs AI Gateway

An AI gateway is a superset of an LLM proxy: it performs the same forwarding, credential, translation, and retry functions, and adds governance, security, and observability for every caller. The difference is the layer above the proxy functions, as Figure 3 shows.

![](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2026/11/what-is-an-llm-proxy-placement.png)

*Figure 3: Every AI gateway includes proxy functions; the difference is the governance layer above them.*

| Capability | Basic LLM proxy | AI gateway (Bifrost) |
| --- | --- | --- |
| One endpoint, many providers | Yes | Yes, 10,000+ models across 25+ providers |
| Provider key isolation | Yes | Yes, with vault integration (Enterprise) |
| Retries and fallbacks | Basic | Key rotation, then provider fallback chains |
| Per-caller identity | Shared credential | Virtual keys, SSO and SCIM (Enterprise) |
| Budgets and rate limits | Rarely | Per key, team, and customer |
| Guardrails | No | PII, secrets, and external guardrail providers (Enterprise) |
| MCP tool governance | No | MCP gateway with per-key tool filtering |
| Audit of configuration changes | No | Signed audit logs (Enterprise) |

Our article on [LLM proxy vs AI gateway](https://www.getmaxim.ai/articles/llm-proxy/) walks through the differences row by row, including when a proxy is still enough.

## How Bifrost Handles LLM Traffic

Bifrost is an AI gateway that covers the LLM proxy pattern and adds governance on top. Applications change one line, the base URL, and keep their existing OpenAI, Anthropic, or Google GenAI SDK code.

```python
from openai import OpenAI

client = OpenAI(
    base_url="<https://bifrost.example.com/openai>",  # Bifrost endpoint
    api_key="sk-bf-your-virtual-key",               # virtual key, not a provider key
)
resp = client.chat.completions.create(
    model="anthropic/claude-sonnet-4-6",
    messages=[{"role": "user", "content": "Summarize this ticket"}],
)
```

Bifrost is a [drop-in replacement](https://docs.getbifrost.ai/features/drop-in-replacement) for those SDKs and adds about 11 microseconds of overhead per request at 5,000 RPS. Requests route to [25+ providers](https://docs.getbifrost.ai/providers/supported-providers/overview), with [retries and fallbacks](https://docs.getbifrost.ai/features/retries-and-fallbacks) that rotate keys before moving to another provider.

Governance sits on [virtual keys](https://docs.getbifrost.ai/features/governance/virtual-keys), each with allowed models, a budget, and rate limits, and every request lands in [built-in request logs](https://docs.getbifrost.ai/features/observability/default) attributed to its caller. Bifrost Enterprise adds [guardrails](https://docs.getbifrost.ai/enterprise/guardrails), SSO, RBAC, and signed audit logs.

The same gateway governs tool traffic as an [MCP gateway](https://www.getmaxim.ai/mcp-gateway), so agent tool calls follow the same keys and logs as model calls. Bifrost is self-hosted: it starts with `npx -y @maximhq/bifrost` or Docker, as the [gateway setup guide](https://docs.getbifrost.ai/quickstart/gateway/setting-up) shows, and runs in your VPC, on-premises, or air-gapped.

## How to Choose an LLM Proxy or Gateway

The right choice depends on how many teams share the endpoint and what the organization must prove about AI usage. A single application with one provider may only need a proxy; shared, multi-team traffic needs a gateway.

Use these questions to decide:

- **How many teams call models?** More than one usually means per-caller keys and budgets.
- **Must prompts stay in your network?** If yes, choose a self-hosted option.
- **Do you need evidence for audits?** Attributed request logs and change logs become requirements.
- **Do agents call tools?** MCP traffic needs the same governance as model traffic.
- **What overhead is acceptable?** Check published latency at your request rate.

For teams moving from a proxy to a gateway, the [LLM Gateway page](https://www.getmaxim.ai/llm-gateway) summarizes routing and failover, the [AI Governance page](https://www.getmaxim.ai/ai-governance) covers access controls, and our [production LLM gateway comparison](https://www.getmaxim.ai/articles/top-5-llm-gateways-in-2026-a-production-ready-comparison/) compares options side by side.

## Frequently Asked Questions

### What is an LLM proxy used for?

An LLM proxy is used to give applications one endpoint for many model providers. It keeps provider API keys on one server, lets teams switch models or providers without code changes, retries transient failures, and logs token usage and latency in one place. Coding agents and internal tools often use one for the same reasons.

### Is an LLM proxy the same as an AI gateway?

No. An AI gateway includes everything an LLM proxy does and adds governance: per-caller identity, budgets and rate limits, guardrails, audit logs, and control over MCP tool traffic. Bifrost is an AI gateway; teams that start with a proxy usually move to a gateway once several teams share the endpoint.

### Does an LLM proxy add latency?

Yes, every hop adds some latency, and the amount depends on the implementation. A well-built gateway adds microseconds, not milliseconds. Bifrost publishes about 11 microseconds of overhead per request at 5,000 requests per second, which is small next to model response times measured in hundreds of milliseconds or more; the [benchmark methodology](https://www.getmaxim.ai/resources/benchmarks) shows how it was measured.

### Can I self-host an LLM proxy?

Yes. Many LLM proxies and gateways are open source and run as a container or binary inside your own network. Self-hosting keeps prompts and responses in your environment and avoids per-token fees from a hosted intermediary. [Bifrost](https://www.getmaxim.ai/) is open source under Apache 2.0 and starts with one `npx` or Docker command.

### What is the difference between an LLM proxy and an MCP proxy?

An LLM proxy forwards model API calls; an MCP proxy forwards Model Context Protocol traffic between AI clients and tool servers. Agents need both, because tool calls carry their own data and access risks. Bifrost handles model calls as an LLM gateway and tool calls as an MCP gateway under one set of keys and logs.

### Do coding agents work with an LLM proxy?

Yes. Claude Code reads `ANTHROPIC_BASE_URL`, and Codex CLI supports custom model providers with their own base URL, so both can send requests through a proxy or gateway. The proxy must speak the API format each tool expects, such as Anthropic Messages for Claude Code and the Responses API for Codex.

## Start with an AI Gateway Instead of a Bare LLM Proxy

An LLM proxy solves the first problem of multi-provider AI: one endpoint and one place for keys. Bifrost covers that pattern and adds the identity, budgets, guardrails, audit, and MCP governance teams need next, with microsecond overhead and a self-hosted deployment. Our [LLM gateway explainer](https://www.getmaxim.ai/topics/llm-gateway) is a good next read.

To see how Bifrost would replace or extend your current LLM proxy, [book a demo](https://www.getmaxim.ai/book-a-demo) with the Bifrost team.

## Read next

[![Migrating from OpenRouter to Bifrost: A Step-by-Step Guide](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/migrating-from-openrouter-to-bifrost-a-step-by-step-guide-bifrost-1920x1080.png) Teams on OpenRouter BYOK already hold their own provider keys, which makes Bifrost a short migration. This guide covers deploying Bifrost, moving keys, changing the base URL, mapping model names and fallbacks, and cutting over Claude Code without downtime.](https://www.getmaxim.ai/articles/migrating-from-openrouter-to-bifrost/)

[![OpenRouter vs Bifrost: Choosing an Enterprise AI Gateway](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/openrouter-vs-bifrost-choosing-an-enterprise-ai-gateway-bifrost-1920x1080.png) OpenRouter is a hosted model router billed through prepaid credits; Bifrost is a self-hosted, open-source AI gateway. This OpenRouter vs Bifrost comparison covers deployment, fees, fallbacks, data handling, team governance, and when to run OpenRouter behind Bifrost.](https://www.getmaxim.ai/articles/openrouter-vs-bifrost/)

[![Qwen CLI: How to Set Up Qwen Code with Any Model](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/qwen-cli-how-to-set-up-qwen-code-with-any-model-bifrost-1920x1080.png) The Qwen CLI, Qwen Code, is Alibaba's open-source terminal coding agent. This guide shows how to install it, connect it to any provider through one OpenAI-compatible endpoint, and give each developer or team a virtual key with its own budget, model access, and logs.](https://www.getmaxim.ai/articles/qwen-cli/)

## More in AI Gateway

[![Migrating from OpenRouter to Bifrost: A Step-by-Step Guide](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/migrating-from-openrouter-to-bifrost-a-step-by-step-guide-bifrost-1920x1080.png) Teams on OpenRouter BYOK already hold their own provider keys, which makes Bifrost a short migration. This guide covers deploying Bifrost, moving keys, changing the base URL, mapping model names and fallbacks, and cutting over Claude Code without downtime.](https://www.getmaxim.ai/articles/migrating-from-openrouter-to-bifrost/)

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "publisher": {
        "@type": "Organization",
        "name": "Maxim Articles",
        "url": "https://www.getmaxim.ai/articles/",
        "logo": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w256h256/2025/08/thumbnail.png",
            "width": 60,
            "height": 60
        }
    },
    "author": {
        "@type": "Person",
        "name": "Kamya Shah",
        "image": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2025/09/WhatsApp-Image-2025-08-29-at-17.40.40-1.jpeg",
            "width": 1200,
            "height": 1600
        },
        "url": "https://www.getmaxim.ai/articles/author/kamya/",
        "sameAs": []
    },
    "headline": "What Is an LLM Proxy? How It Works and Where It Stops",
    "url": "https://www.getmaxim.ai/articles/what-is-an-llm-proxy/",
    "datePublished": "2026-11-26T06:54:00.000Z",
    "dateModified": "2026-11-28T06:56:29.000Z",
    "image": {
        "@type": "ImageObject",
        "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/11/what-is-an-llm-proxy-how-it-works-and-where-it-stops-bifrost-1920x1080.png",
        "width": 1200,
        "height": 675
    },
    "keywords": "AI Gateway",
    "description": "An LLM proxy is a server between applications and model providers that forwards requests through one endpoint, holding provider keys and translating formats. This guide explains how an LLM proxy works, what it is used for, where it stops, and what an AI gateway adds.",
    "mainEntityOfPage": "https://www.getmaxim.ai/articles/what-is-an-llm-proxy/"
}
```
