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).
Desktop app (AI / OpenCode)
Section titled “Desktop app (AI / OpenCode)”| Variable | Description | Default |
|---|---|---|
VITE_AI_GATEWAY_DEV_MODE | Route AI provider traffic to local web API (true) or deployed API (false). | false |
VITE_ACCOUNT_DEV_MODE | Route entitlements/checkout requests to local web API (true) or deployed API (false). | false |
VITE_CLOUDFLARE_DEV_MODE | Route publish proxy requests to local web API (true) or deployed API (false). | false |
VITE_CLERK_AI_TOKEN_TEMPLATE | Optional Clerk JWT template for AI token retrieval. | — |
OPENCODE_BIN | Path 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.
Web API (server-only)
Section titled “Web API (server-only)”| Variable | Description | Default |
|---|---|---|
AI_GATEWAY_API_KEY | Vercel AI Gateway API key used by /api/ai proxy routes. | — |
AI_GATEWAY_BASE_URL | Optional 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=trueso AI calls usehttp://localhost:3001/api/ai.