Skip to main content
Look up what each setting in an .env file does.
Self-hosting? You don’t need this page to get started. gaia up writes a working configuration and generates every secret. See CLI setup. Add AI and tool keys in Settings → Providers & Tools, no file editing needed.
Most variables are optional. A missing key turns off one feature, and the app still starts.

How settings load

Settings live in apps/api/app/config/settings.py and run in one of three modes:

Manual setup (contributors)

1

Copy the example files

2

Set the minimum

In apps/api/.env:
AUTH_MODE=local gives email-and-password sign-in with no outside service. For WorkOS, use AUTH_MODE=workos and set the WorkOS variables.
3

Start


API Environment Variables

On a self-hosted instance, the provider and tool keys (AI providers, search, Firecrawl, OpenWeather, LlamaParse, GitHub, Cloudinary, Google OAuth, Composio, Resend, E2B) can be set in Settings → Providers & Tools instead, where they are stored encrypted. The environment variable is used when nothing is saved there.

Always Required

These are required in every mode: In production and self-host, these are also required:

Instance & Auth Mode

Environment & Deployment


Database & Message Queue

When using Docker Compose, these have sensible defaults.

Authentication & OAuth

AUTH_MODE selects the sign-in method: workos routes users through WorkOS’s AuthKit hosted UI, while local enables first-party email + password accounts (the self-host default, also usable in development so contributors need no WorkOS account — the first account created becomes the instance admin, and others join by invite link from Settings → Members). The three WORKOS_* variables are validated and required only when AUTH_MODE=workos.
Computed OAuth callback URLs are generated automatically: - WORKOS_REDIRECT_URI → {HOST}/api/v1/oauth/workos/callback - GOOGLE_CALLBACK_URL → {HOST}/api/v1/oauth/google/callback - COMPOSIO_REDIRECT_URI → {HOST}/api/v1/oauth/composio/callback - DISCORD_OAUTH_REDIRECT_URI → {HOST}/api/v1/platform-auth/discord/callback - SLACK_OAUTH_REDIRECT_URI → {HOST}/api/v1/platform-auth/slack/callback
DISCORD_OAUTH_CLIENT_ID and SLACK_OAUTH_CLIENT_ID are optional, without them, users must link their accounts using the /auth bot command instead of the web UI. See Discord Bot and Slack Bot for setup instructions.

AI & Machine Learning

Self-host: set these in Settings → Providers & Tools instead. The variables are fallbacks, and a saved key wins.
OpenAI-compatible gateways (OpenCode, Nous Research, or any custom endpoint) are also configured through Settings → Providers & Tools.

Search & Web Content


Media & Content Processing


External Integrations


Memory & Context

Memory runs locally on PostgreSQL, ChromaDB and a local embedding model. No keys are needed, and the defaults work.

Payments

Self-host never contacts Dodo, so no payment keys are needed.

Voice Agent


Monitoring & Analytics


Web Environment Variables

Set these in apps/web/.env:

Full Example

gaia up generates this for you — shown here for reference:
Everything else is optional. AI provider keys are added at runtime in Settings → Providers & Tools; Infisical is never contacted.

Generate the file for you

gaia up writes a complete self-host configuration. For a source checkout, run the interactive wizard:
It reads the config schema and .env.example, asks only for missing values, and checks the result.

See Also