Use config.yml to configure core gateway settings for self-hosted Otari Gateway deployments.
The config file is passed at startup with --config:
gateway serve --config config.yml
Full example
# Database
database_url: "postgresql://gateway:gateway@postgres:5432/gateway"
# Server
host: "0.0.0.0"
port: 8000
# Auth
master_key: "your-secret-master-key"
# Rate limiting (requests per minute per user, omit to disable)
# rate_limit_rpm: 60
# Prometheus metrics at /metrics
# enable_metrics: true
# Providers
providers:
openai:
api_key: "sk-..."
anthropic:
api_key: "sk-ant-..."
mistral:
api_key: "..."
vertexai:
credentials: "/app/service_account.json"
project: "my-gcp-project"
location: "us-central1"
# Pricing (USD per million tokens)
pricing:
openai:gpt-4o:
input_price_per_million: 2.50
output_price_per_million: 10.00
Config reference
Field | Type | Default | Description |
| string |
| Database connection URL (SQLite or PostgreSQL) |
| bool |
| Run Alembic migrations automatically on startup |
| int |
| Persistent DB connections per worker |
| int |
| Extra burst connections above pool size |
| float |
| Seconds to wait for a connection |
| int |
| Recycle connections older than N seconds (-1 = disabled) |
| string |
| Server bind host |
| int |
| Server bind port |
| string | none | Master key for management endpoints |
| int | none | Max requests per minute per user (none = disabled) |
| list |
| Allowed CORS origins (empty = disabled) |
| dict |
| Provider credentials (see below) |
| dict |
| Model pricing entries |
| bool |
| Enable Prometheus |
| bool |
| Enable |
| bool |
| Create a first-use API key on startup when none exist |
| string |
| Usage log writing: |
| string |
| Budget validation: |
| string |
| Configured mode ( |
| dict |
| otari.ai integration settings ( |
Source: mozilla-ai/otari/docs/configuration.md
