> For the complete documentation index, see [llms.txt](https://docs.otari.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otari.ai/otari/index.md).

# Otari

Otari is an OpenAI-compatible LLM gateway. It routes to 40+ providers, manages API keys, enforces budgets, and records usage. It is also the gateway at the heart of [otari.ai](https://otari.ai).

## New here?

Start with the [Quickstart](/otari/start-here/quickstart.md).

## Browse the docs

The docs are grouped by what you are trying to do.

### Start here

* [Quickstart](/otari/start-here/quickstart.md): get running and make your first request.

### For operators

Running and managing a gateway.

* [Deployment](/otari/for-operators/deployment.md): Docker, Railway, and optional services.
* [Configuration](/otari/for-operators/configuration.md): configuration sources, precedence, and common settings.
* [Admin dashboard](/otari/for-operators/dashboard.md): sign-in, setup, and management surfaces.
* [Access control](/otari/for-operators/access-control.md): identities, organizations, workspaces, keys, and budgets.
* [Workload identity](/otari/for-operators/workload-identity.md): a backend on Google Cloud authenticates with its platform identity token instead of a key's secret.
* [Models](/otari/for-operators/models.md): selectors, providers, discovery, aliases, and capabilities.
* [Hosted providers](/otari/for-operators/hosted-providers.md): credentials the deployment pays for, and how requests on them are billed.
* [Provider endpoints](/otari/for-operators/provider-endpoints.md): model servers a workspace or a user brings, reached by name and kept out of budgets.
* [Routing policies](/otari/for-operators/routing.md): failover, conditions, weighted, priority and learned routing, and mandatory guardrails.
* [Health checks](/otari/for-operators/health-checks.md): a scheduled check of every model the deployment serves, and email when one stops answering.
* [OpenAI provider guide](/otari/for-operators/openai.md): configure OpenAI and route your first request through Otari.
* [Gemini provider guide](/otari/for-operators/gemini.md): configure Gemini and route your first request through Otari.

### For integrators

Calling the gateway from your own code.

* [API reference](/otari/for-integrators/api-reference.md): authentication, endpoint availability, and links to generated schemas.
* [Built-in tools](/otari/for-integrators/tools.md): sandboxed code execution and web search Otari runs itself.
* [MCP](/otari/for-integrators/mcp.md): connect MCP servers to chat, messages, and responses requests, or drive them from your own application through the caller-orchestrated endpoints.
* [Files](/otari/for-integrators/files.md): file uploads and document understanding for local models.
* [Inference Guardrails](/otari/for-integrators/guardrails.md): request-level checks like prompt-injection detection.
* [Agent Guardrails](/otari/for-integrators/agent-guardrails.md): repository-owned rules checked against what a coding agent actually did to the working tree. `otari hook` runs beside Claude Code or Codex and evaluates them locally, with no server and no credential.
* [Agent Guardrails reference](/otari/for-integrators/agent-guardrails-reference.md): every gate type and field, and what each harness can see at each event.
* [Use with Claude Code](/otari/for-integrators/use-with-claude-code.md): point the Claude Code CLI at Otari.
* [Use with Codex](/otari/for-integrators/use-with-codex.md): route the Codex CLI through Otari over the Responses API, or import its usage without routing.
* [Use with opencode](/otari/for-integrators/use-with-opencode.md): point the opencode CLI at Otari.
* [Use with Pydantic AI](/otari/for-integrators/use-with-pydantic-ai.md), [Use with LangChain](/otari/for-integrators/use-with-langchain.md) and [Use with LangGraph](/otari/for-integrators/use-with-langgraph.md): point an agent framework's model at Otari, with tools, structured output and streaming.
* [Use with a ChatGPT subscription](/otari/for-integrators/chatgpt-subscription.md): route Otari at ChatGPT Plus/Pro models through a local Codex-OAuth proxy.
* [Agent traces](/otari/for-integrators/traces.md): see each agent session as turns, LLM calls and tool calls, with their timing and cost.
* [Importing external usage](/otari/for-integrators/external-usage.md): bring subscription-backed usage (Claude Code, Codex, any OTLP app) into your analytics.
* [SDK compatibility](/otari/for-integrators/sdk-compatibility.md): how the language SDKs are released and which SDK version works with which Otari version.

### For platform builders

* [Code-execution protocol](/otari/for-platform-builders/code-execution-protocol.md): the Otari/sandbox contract, for building a code-execution backend that Otari dispatches to. Its machine-readable form is [`public/code-execution-openapi.yaml`](https://github.com/mozilla-ai/otari/blob/v0.33.0/docs/public/code-execution-openapi.yaml).

### For contributors

* [Architecture](https://github.com/mozilla-ai/otari/blob/v0.33.0/ARCHITECTURE.md): one process over one database, and the extension seam (ports, adapters, and capability lines) that mark what Otari's core ships versus what an overlay can add.
* [Backend domains](https://github.com/mozilla-ai/otari/blob/v0.33.0/DOMAINS.md): what each backend domain owns, and the layer shape each domain moves toward.
* [Load test](https://github.com/mozilla-ai/otari/blob/v0.33.0/loadtest/README.md): compares two builds under load on one machine, route by route, and fails when the second got slower or runs more database statements per request. CI runs it on a PR against its base.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.otari.ai/otari/index.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
