What is Otari?
Otari is an open-source AI gateway from Mozilla.ai that you run on your own infrastructure. It sits between your applications and the model providers: it authenticates each request, resolves the provider credentials, enforces budgets before the call is dispatched and records usage afterwards. It sits in the Gateways & Routing category of the Evaluation & Production Ops tools and is open-source, written in Python and licensed Apache-2.0.
Overview
Otari is an open-source AI gateway from Mozilla.ai that you run on your own infrastructure. It sits between your applications and the model providers: it authenticates each request, resolves the provider credentials, enforces budgets before the call is dispatched and records usage afterwards. Applications talk to one OpenAI- and Anthropic-compatible endpoint that fronts 40+ providers, and the provider calls themselves go through Mozilla.ai's any-llm library.
Its job is to keep provider keys and spending under the operator's control. Clients get revocable API keys scoped to a user, a workspace and a set of models, so they never see the upstream credentials; budgets are checked before spend and settled after it. A web dashboard manages providers, models, routing, tools, keys, members, budgets, activity and usage, and the running server publishes Swagger UI and an OpenAPI document for its completion and management APIs.

Routing is expressed as policies: a caller-facing model name that resolves to one or more real models, used for failover, conditional selection, weighted traffic splitting and spill-over past a rate limit. Optional services add server-side code execution, web search, MCP, inference guardrails and file understanding. Mozilla.ai announced Otari in May 2026 together with Otari.ai, a hosted platform built on the same engine.
What it does
- One OpenAI- and Anthropic-compatible endpoint (`/api/v1/chat/completions`, `/api/v1/messages`, `/api/v1/responses`) for 40+ providers
- Revocable virtual API keys scoped by user, workspace and model, with provider credentials kept behind the gateway
- Budget checks before a request is dispatched and usage records after it settles

- Routing policies for failover, conditional selection, weighted traffic splitting and spill-over past a rate limit
- Optional code execution sandbox, web search, MCP, inference guardrails and file understanding
- Dashboard for providers, models, routing, keys, members, budgets, activity and usage, plus a model Playground
- Single Docker container on SQLite, or Docker Compose on PostgreSQL
Getting started
The README's quickstart runs the whole gateway from one Docker image with no configuration; the Compose setup adds PostgreSQL and the optional services.
Start the gateway
The `otari` volume keeps the SQLite database and the key that encrypts stored provider credentials, so a new container with the same volume keeps its data.
docker run -v otari:/data -p 127.0.0.1:8000:8000 mzdotai/otari:latestFinish setup in the dashboard
On first start Otari prints a one-time setup link that carries the master key. Open it, choose the email and password you will sign in with, add a provider on the Hosted providers page and enable default pricing there. Then create an API key on the API keys page.
Open this link to choose your password and finish setup:
http://localhost:8000/setup#key=otari-mk-...Send a request
Use the key you created. OpenAI clients work by setting `base_url` to `http://localhost:8000/api/v1`.
curl http://localhost:8000/api/v1/chat/completions \
-H "Authorization: Bearer tk-..." \
-H "Content-Type: application/json" \
-d '{
"model": "openai:gpt-4o-mini",
"messages": [{"role": "user", "content": "Say hello."}]
}'
Add a failover policy
From the routing docs: callers send `model: fast`, and if the first provider fails before any response is sent, Otari tries the fallback.
routing:
policies:
fast:
select:
- default: openai:gpt-5-mini
on_failure:
- anthropic:claude-haiku-4-5Run the full stack
Compose runs Otari on PostgreSQL; the optional profiles add the code sandbox and web search services.
git clone https://github.com/mozilla-ai/otari
cd otari
cp config.example.yml config.yml
# set a master key, provider credentials and pricing in config.yml
docker compose pull
docker compose up -d
docker compose --profile code-exec --profile web-search up -dCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Give teams and applications their own revocable, budget-capped keys without handing out provider credentials
- Fail over from one provider to another, or split traffic between models, behind a single model name
- Track spend, tokens, latency and failures per user, key and model in one place

- Compare two models side by side in the Playground before pointing a routing policy at one
How Otari compares
Otari alongside other open-source gateways & routing tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| OmniRoute | ★ 91.8k | A local-first AI gateway that fronts hundreds of model providers with one OpenAI-compatible endpoint, quota-aware auto-fallback, many routing strategies and prompt compression. |
| Free Claude Code | ★ 75.9k | A local proxy that points Claude Code, Codex, Pi, OpenCode, Cline and other agent CLIs at 50 free, paid, subscription or local model providers, with automatic failover and an admin UI. |
| LiteLLM | ★ 64.4k | A Python SDK and proxy server that gives one OpenAI-compatible API to 100+ LLM providers, with cost tracking, budgets, fallbacks, rate limiting, and an admin UI. |
| magpie | ★ 44.8k | Menu bar app and local gateway that lets Claude Code, Codex, Gemini CLI and dozens of other coding agents run on any provider's model, with routing groups that fail over across accounts when a quota runs out. |
| Kong Gateway | ★ 44.4k | A Lua/NGINX API gateway whose AI Gateway plugins put one universal endpoint in front of OpenAI, Anthropic, Gemini, Bedrock and other providers, with semantic routing, caching and MCP traffic governance. |
| 9Router | ★ 33.1k | Local OpenAI-compatible router for coding CLIs that tracks per-provider quota, falls back from subscription to cheap to free models, and compresses tool results to cut tokens. |
| Experiential | ★ 20.6k | An open-source gateway that puts hosted, BYOK, local and custom models behind one OpenAI-compatible API, with per-identity model and spend limits and routers fitted from your own traces. |
| Otari | ★ 1k | Mozilla.ai's self-hosted AI gateway with virtual keys, budgets and routing policies |
