Skip to main content

Environment reference

The studio reads two kinds of variable: NEXT_PUBLIC_* values, which are inlined at build time and must be passed as Docker build arguments, and everything else, which is read when the server starts. Spire reads its own set, prefixed SPIRE_, plus the shared sign-in secret.

The studio​

Build time (NEXT_PUBLIC_*)​

VariableDefaultPurpose
NEXT_PUBLIC_APP_SURFACEstudio in the imagestudio serves unprefixed routes; any other value is the suite-embedded surface under /ade/studio
NEXT_PUBLIC_STUDIO_BASE_PATHunsetExplicit route prefix, overriding the surface's default
NEXT_PUBLIC_MAIN_APP_URLhttps://main.apiome.devThe main app's origin. Sign-in redirects go to <main app>/login?callbackUrl=…. Must not be this deployment's own origin, or a signed-out visitor loops on /login
NEXT_PUBLIC_STUDIO_URLhttps://suite.apiome.devThis deployment's own public URL; the main app links to it from the suite dropdown
NEXT_PUBLIC_API_URLhttps://api.apiome.devThe public API origin
NEXT_PUBLIC_REST_API_BASE_URLhttp://localhost:8000/v1Build-time fallback for REST_API_BASE_URL
NEXT_PUBLIC_SPIRE_API_BASE_URLhttp://localhost:8099/v1Build-time fallback for SPIRE_API_BASE_URL
NEXT_PUBLIC_STUDIO_UNIFIED_WORKSPACEunset (off)Workspace rollout stage: 1 (preview), default, only — see Deploy the studio
NEXT_PUBLIC_STUDIO_WORKSPACE_PROFILERunsetShows the workspace's memory panel
NEXT_PUBLIC_REPO_WORKFLOWSunset1 shows the Arazzo Workflows node in the sidebar
NEXT_PUBLIC_BROWSE_URLunsetThe browse app's URL, for links out of the studio

Runtime​

VariableDefaultPurpose
PORT3003 (image and run.sh; .env.example says 3004)Listening port
HOSTNAME (HOST as an alias)0.0.0.0Bind address
REST_API_BASE_URLthe build-time fallbackapiome-rest's base URL, e.g. http://rest:8000/v1 in Docker
SPIRE_API_BASE_URLthe build-time fallbackSpire's base URL, e.g. http://spire:8099/v1 in Docker
DATABASE_URL—The Apiome Postgres database, for sessions and the Paths canvas's server actions. Same value as apiome-ui
BETTER_AUTH_SECRET—The shared sign-in secret. Byte-identical to apiome-ui's. Without it no session can be read and no service bearer is minted
BETTER_AUTH_URL—This deployment's own public URL (per origin)
BETTER_AUTH_COOKIE_DOMAINinferred from the URLsThe parent domain both origins sit under, e.g. .apiome.dev. Identical to apiome-ui's. Used in production only
INTERNAL_SERVICE_TOKENunsetLets the studio's sign-in handler read admin-screen provider configuration from apiome-rest. Identical to apiome-ui's and apiome-rest's. Unset, same-origin sign-in uses the OAuth variables below only
GITHUB_ID, GITHUB_SECRET, GITLAB_CLIENT_ID, GITLAB_CLIENT_SECRETunsetOAuth providers for same-origin sign-in; the same values as apiome-ui
STUDIO_BFF_FALLBACK_URL, APIOME_UI_INTERNAL_URLunsetDevelopment only: forward unported /api/* routes to a running apiome-ui. Omit in production
OLLAMA_BASE_URLhttp://localhost:11434The Ollama server behind the canvas AI buttons and chat
OLLAMA_CHAT_CACHE_MAX_ENTRIES, OLLAMA_CHAT_CACHE_MAX_RESPONSE_CHARS, OLLAMA_CHAT_CACHE_DISABLED, OLLAMA_CHAT_CACHE_SEMANTIC_DISABLED, OLLAMA_CHAT_CACHE_SEMANTIC_THRESHOLD—The chat response cache's size, limits and semantic matching
NEXTAUTH_URL, NEXTAUTH_COOKIE_DOMAIN, NEXTAUTH_SECRET—Retired. The studio reads none of them; setting one earns a startup warning

Spire​

Spire reads .env in its working directory and the process environment.

VariableDefaultPurpose
SPIRE_DATABASE_URL—The Apiome Postgres database. Spire's tables live in its authoring schema (search_path=authoring,public). Required for migrations, entitlement lookups and every store
BETTER_AUTH_SECRETinsecure fallback outside productionThe shared HS256 secret the studio signs service bearers with. Byte-identical to the studio's
JWT_SECRETinsecure fallback outside productionA second secret to verify bearers against, for rotations
NEXTAUTH_SECRET—Must be absent. Spire refuses to start while it is set, even blank
SPIRE_CREDENTIAL_ENCRYPTION_KEY—Passphrase from which the key that encrypts stored tenant LLM API keys is derived
SPIRE_AUTHORING_GATING_ENABLEDtruefalse skips the authoring entitlement check; authentication is still required
SPIRE_SLATE_ARTIFACT_DIRa temporary directoryWhere Slate build ZIPs are written
APP_ENV / SPIRE_ENVIRONMENT—production or prod makes Spire fail closed when a secret is missing instead of using a fallback
FLYWAY_SCHEMA_HISTORY_TABLE, FLYWAY_DEFAULT_SCHEMAflyway_schema_history, publicOverrides for the migration runner

The ports: the studio listens on 3003, Spire on 8099, apiome-rest on 8000.