This guide runs a persistent standalone Otari with Docker Compose. For an ephemeral, no-clone example, use the README quickstart.
- Docker with Compose
- A provider API key
git clone https://github.com/mozilla-ai/otari
cd otari
cp config.example.yml config.ymlEdit config.yml to set a master key, provider, and pricing:
database_url: "postgresql://otari:otari@postgres:5432/otari"
master_key: "choose-a-strong-management-key"
default_pricing: true
providers:
openai:
api_key: "sk-..."This local file is gitignored. For a shared deployment, inject secrets through the environment or your platform's secret manager instead.
default_pricing: true uses bundled prices for common models. Without it,
add explicit pricing for the model you call. Otari rejects unpriced budgeted
traffic by default.
To store provider credentials through the dashboard instead, leave
providers empty and set OTARI_SECRET_KEY to a Fernet key generated by
otari gen-secret-key.
docker compose pull
docker compose up -d
curl http://localhost:8000/healthThe first startup on an empty database creates an API key and prints it once.
Find the gw- value in the Otari container logs. You can also create a key
from the dashboard at http://localhost:8000/.
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."}]
}'The request is authenticated, checked against applicable budgets, routed with the provider credential held by Otari, and recorded in Activity and Usage.