ReferenceOperating

Environment variables

Every variable the API and UI read, with validation rules and failure behaviour.

Configuration is validated at startup. The API refuses to start rather than running in an ambiguous state.

API — required

VariableRule
API_ORIGINAbsolute URL of the API itself.
UI_ORIGINAbsolute URL of the UI. Also the only permitted CORS origin.
DATABASE_URLPostgreSQL connection string.
BETTER_AUTH_SECRETAt least 32 characters.
SCHEDULER_SECRETAt least 32 characters. Guards /internal/scheduler/tick.
ENCRYPTION_KEYBase64 that decodes to exactly 32 bytes.

Generate the encryption key with:

openssl rand -base64 32

API — inference

VariableDefaultRule
LLM_GATEWAY_API_KEYRequired unless DEMO_MODE=true. Never required for the public model directory.
LLM_GATEWAY_DEFAULT_MODELopenai/gpt-5-miniNon-empty string.
DEMO_MODEfalsetrue or false. Rejected outright in production.
NODE_ENVdevelopmentdevelopment, production, or test.

Startup fails when:

  • NODE_ENV=production and DEMO_MODE=true;
  • LLM_GATEWAY_API_KEY is absent and DEMO_MODE is not true; or
  • ENCRYPTION_KEY does not decode to 32 bytes.

Empty is the same as unset

An empty assignment such as LLM_GATEWAY_API_KEY= is treated as absent, so a checked-in .env.example placeholder never satisfies a requirement by accident.

API — connection providers

Every provider is optional and enabled by supplying its credentials. A provider without credentials is listed in the dashboard with its connect action disabled.

VariableDefaultNotes
GITHUB_OAUTH_CLIENT_IDEnables the GitHub connection.
GITHUB_OAUTH_CLIENT_SECRETGitHub OAuth apps do not support PKCE.
POSTHOG_OAUTH_CLIENT_IDEnables the PostHog connection.
POSTHOG_OAUTH_CLIENT_SECRET
POSTHOG_OAUTH_ISSUERhttps://oauth.posthog.comMust be an absolute URL.

Register each callback as ${API_ORIGIN}/oauth/callback/<provider>.

Zernio needs no deployment configuration — each project pastes its own API key.

UI

VariableNotes
API_ORIGINWhere the UI proxies /api/auth/* and /api/service/*.
DOCS_ORIGINWhere documentation links point.

Local development

.env.example holds local-only fixtures and is safe to copy:

cp .env.example .env
docker compose up -d postgres
pnpm db:migrate
pnpm db:seed
pnpm dev

Generate fresh BETTER_AUTH_SECRET, ENCRYPTION_KEY, and SCHEDULER_SECRET values for every deployed environment. .env files are ignored by git and must never be committed.

On this page

Edit this page on GitHub