Skip to main content

Environment variables

Override gateway settings, provide credentials, and configure otari.ai connectivity with environment variables.

The following OTARI_ variables override config file values for their matching fields. For example, OTARI_PORT=9000 overrides port: 8000 in the YAML.

The config file also supports ${ENV_VAR} interpolation:

master_key: "${MY_SECRET_KEY}"

Common variables

Variable

Description

OTARI_MASTER_KEY

Master key for management endpoints

OTARI_DATABASE_URL

Database connection URL

OTARI_HOST

Server bind host

OTARI_PORT

Server bind port

OTARI_AUTO_MIGRATE

Auto-run migrations on startup

OTARI_BOOTSTRAP_API_KEY

Create first-use API key

Provider credentials

Provider API keys can be set as environment variables instead of in the config file. These are picked up directly by the underlying SDK.

These credentials are used for standalone deployments. When connected to otari.ai, local provider credentials are not used.

Variable

Provider

OPENAI_API_KEY

OpenAI

ANTHROPIC_API_KEY

Anthropic

MISTRAL_API_KEY

Mistral

GEMINI_API_KEY

Google Gemini

Otari variables

These are only relevant when running connected to otari.ai. See Modes for details.

Variable

Default

Description

OTARI_AI_TOKEN

--

Gateway token from otari.ai (enables platform connection)

PLATFORM_RESOLVE_TIMEOUT_MS

5000

Timeout for provider resolution calls

PLATFORM_USAGE_TIMEOUT_MS

5000

Timeout for usage reporting calls

PLATFORM_USAGE_MAX_RETRIES

3

Max retries for transient usage reporting failures

STREAMING_FALLBACK_FIRST_CHUNK_TIMEOUT_MS

2000

Per-attempt timeout waiting for first streamed chunk

Source: mozilla-ai/otari/docs/configuration.md

Did this answer your question?