Skip to content
Download

Environment variables

The app and the OpenCode integration respect the following environment variables. Set them in your system environment or in a project .env file (if supported).

VariableDescriptionDefault
VITE_AI_GATEWAY_DEV_MODERoute AI provider traffic to local web API (true) or deployed API (false).false
VITE_ACCOUNT_DEV_MODERoute entitlements/checkout requests to local web API (true) or deployed API (false).false
VITE_CLOUDFLARE_DEV_MODERoute publish proxy requests to local web API (true) or deployed API (false).false
VITE_CLERK_AI_TOKEN_TEMPLATEOptional Clerk JWT template for AI token retrieval.
OPENCODE_BINPath to the OpenCode CLI binary (if not using the bundled one).

Desktop defaults (Clerk key, OpenCode base URL, model, deployed API URL) are configured in apps/app/src/config.ts.

VariableDescriptionDefault
AI_GATEWAY_API_KEYVercel AI Gateway API key used by /api/ai proxy routes.
AI_GATEWAY_BASE_URLOptional override for AI Gateway base URL.https://ai-gateway.vercel.sh/v1

The desktop app keeps OpenCode local, and sends model traffic through the web /api/ai proxy so provider keys stay server-side.

  • For @plan and lightweight tasks, OpenCode may use a smaller model; the main model is used for @build and full edits.
  • For local desktop development, set VITE_AI_GATEWAY_DEV_MODE=true so AI calls use http://localhost:3001/api/ai.