# Copy to `.env` and adjust. CLI flags (--port, --opencode_url, --api_key) # override these values. # `node server.js` reads this file automatically (built-in loader, no dotenv # dependency). Precedence: CLI flags > shell env > `.env` file > defaults. # `docker compose` also loads `.env` automatically. # Adapter listening port (default: 80) PORT=55890 # Backend opencode serve URL (default: http://127.0.0.1:4096) OPENCODE_URL=http://127.0.0.1:4096 # Bearer token for auth. Leave empty to disable auth. API_KEY= # Control-plane backend timeout in ms: health, models, sessions (default: 15000) OPENCODE_TIMEOUT=15000 # Generation timeout in ms, blocking and streaming (default: 300000) OPENCODE_MESSAGE_TIMEOUT=300000 # Extra attempts on network-level backend failures (default: 1) OPENCODE_RETRIES=1 # SSE heartbeat interval in ms for streams (default: 15000, 0 disables) STREAM_HEARTBEAT_MS=15000 # Master switch for SSE streaming: 0 serves stream requests blocking as JSON (default: 1) ENABLE_STREAMING=1 # Bind address: 127.0.0.1 = localhost only (default: 0.0.0.0) HOST=0.0.0.0 # Enable CORS for this origin ("*"), empty = off CORS_ORIGIN= # Vision model forced when messages contain images (default: qwen3.6-plus-free) VISION_MODEL=qwen3.6-plus-free # Default-on thinking when requests say nothing (default: 0) INCLUDE_REASONING=0 # Request logging: error|warn|info|debug (default: info) LOG_LEVEL=info