# Otari: Self-Hosted OpenAI-Compatible LLM Gateway for 40+ Providers

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/mozilla-ai-otari
Generated for open source discovery and AI-assisted research.

Otari, from Mozilla AI, is an open-source, self-hosted LLM gateway. It provides a single OpenAI-compatible endpoint to connect with over 40 model providers, offering features like virtual keys, budget enforcement, and usage tracking. This solution empowers users to manage their AI stack with greater control and flexibility.

GitHub: https://github.com/mozilla-ai/otari
OSRepos URL: https://osrepos.com/repo/mozilla-ai-otari

## Summary

Otari, from Mozilla AI, is an open-source, self-hosted LLM gateway. It provides a single OpenAI-compatible endpoint to connect with over 40 model providers, offering features like virtual keys, budget enforcement, and usage tracking. This solution empowers users to manage their AI stack with greater control and flexibility.

## Topics

- ai-gateway
- llm
- openai-compatible
- self-hosted
- api-key-management
- cost-tracking
- llmops
- python

## Repository Information

Last analyzed by OSRepos: Fri Sep 04 2026 21:23:53 GMT+0100 (Western European Summer Time)
Detail views: 0
GitHub clicks: 1

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction

Otari, from Mozilla AI, is an open-source, self-hosted LLM gateway designed to simplify interaction with various large language model providers. It offers a single OpenAI-compatible endpoint, allowing seamless integration with over 40 different LLM providers. Users can issue virtual API keys, enforce budgets, and track usage, gaining full control over their AI infrastructure.

## Why Use Otari and Key Benefits

Otari provides a robust solution for managing your LLM interactions with several compelling advantages:

*   One OpenAI and Anthropic-compatible endpoint for many providers.
*   Provider credentials stay securely behind the gateway.
*   Revocable API keys with user, workspace, and model scope.
*   Budget checks before spend and comprehensive usage records after settlement.
*   Local routing policies for failover, weighting, and learned selection.
*   Optional features including code execution, web search, multi-cloud provisioning (MCP), guardrails, and file understanding.

## Installation

Getting started with Otari is straightforward. You can run an ephemeral standalone gateway using Docker:

bash
docker run --rm -p 8000:8000 \
  -e OTARI_MASTER_KEY=SET_A_MASTER_KEY \
  -e OPENAI_API_KEY=YOUR_OPENAI_KEY \
  -e OTARI_CONFIG_YAML='default_pricing: true' \
  mzdotai/otari:latest \
  otari serve


For a full-stack deployment with persistent data, including PostgreSQL, clone the repository and use Docker Compose:

bash
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


The dashboard will be accessible at `http://localhost:8000/`. Optional services like code sandbox, web search, and guardrails can be enabled via Docker Compose profiles.

## Examples

Once Otari is running, you can send requests using the generated bootstrap API key. OpenAI clients can also be configured by setting `base_url` to `http://localhost:8000/v1`.

Here's an example using `curl` to send a chat completion request:

bash
curl http://localhost:8000/v1/chat/completions \
  -H "Authorization: Bearer gw-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai:gpt-4o-mini",
    "messages": [{"role": "user", "content": "Say hello."}]
  }'


## Links

Explore Otari further through these official resources:

*   GitHub Repository: [https://github.com/mozilla-ai/otari](https://github.com/mozilla-ai/otari){:target="_blank"}
*   Official Website: [https://otari.ai](https://otari.ai){:target="_blank"}
*   Documentation: [https://otari.ai/docs](https://otari.ai/docs){:target="_blank"}
*   Launch Blog: [https://blog.mozilla.ai/otari-own-your-ai-stack/](https://blog.mozilla.ai/otari-own-your-ai-stack/){:target="_blank"}
*   Discord Community: [https://discord.gg/ZfZPfTdtSe](https://discord.gg/ZfZPfTdtSe){:target="_blank"}