# Boelabs AI Gateway — One contract for every model provider

> Open-source artificial intelligence gateway: one OpenAI-compatible API in front of OpenAI, Anthropic, Google and more, with routing, fallbacks, virtual keys, budgets, caching and per-request costs.

URL: https://boelabs.com/en/ai-gateway
Language: English (en-US) — also in: [Español](https://boelabs.com/ai-gateway.md?lang=es) · [Português](https://boelabs.com/ai-gateway.md?lang=pt) · [Français](https://boelabs.com/ai-gateway.md?lang=fr)

A single, stable, OpenAI-compatible API in front of every provider your team uses. Your app keeps one integration; the gateway owns authentication, routing, rate limits, budgets, caching, costs and observability.

- [View on GitHub](https://github.com/boelabs/ai-gateway)

## Switching providers stops being a release

| Without a gateway | With AI Gateway |
| --- | --- |
| One SDK and auth scheme per vendor | One OpenAI-compatible contract for all of them |
| Vendor outages reach your users | Weighted pools, cooldowns, retries and fallbacks |
| Vendor keys scattered across every service | Virtual keys with scopes, limits and budgets |
| Spend and latency invisible until the invoice | Per-request costs, logs and OpenTelemetry |
| Provider migrations are code changes | Provider migrations are configuration changes |

## Everything between your app and the models

### Public contracts

Exact OpenAI shapes for chat, Responses, images, embeddings, audio, video, reranking and models, plus an Anthropic-compatible /v1/messages.

### Providers

OpenAI, Anthropic, Google AI Studio, Azure, Vercel AI Gateway, OpenRouter, DeepSeek and more, or any OpenAI-compatible endpoint.

### Routing

Public aliases over weighted deployment pools, with cooldowns, retries and explicit fallback chains.

### Access control

A master key for operations and virtual keys per client, with model scopes, per-minute limits and budgets.

### Operations

Opt-in caching, durable logs, per-request cost accounting, and OpenTelemetry metrics and traces.

### Extensions

Request, response and stream hooks loaded at runtime through the Admin API, without forking the gateway.

## Translate, route, execute

1. **Translate**: Every request, whether it uses the OpenAI or the Anthropic contract, becomes one canonical representation.
2. **Route**: The router picks a deployment from the alias's pool based on strategy, cooldowns and configured fallbacks.
3. **Execute**: One adapter per provider speaks its protocol; nothing provider-specific leaks into the core or your response.

## Yours to run wherever you want

MIT licensed. Published images that only need Postgres and Redis, plus an optional operator dashboard on its own domain for models, keys, logs, usage and a playground.

- Behind our own products, in production.
- One image is promoted between environments: configuration doesn't live in it.
- Before 1.0, breaking changes are still possible.

- `ghcr.io/boelabs/ai-gateway-api`: The API
- `ghcr.io/boelabs/ai-gateway-dashboard`: The operator dashboard

[GitHub](https://github.com/boelabs/ai-gateway)
