# ============================================================ # onWatch - Multi-Provider API Usage Tracker # Copy this file to .env and fill in your values # ============================================================ # --- Synthetic API Configuration --- # Your Synthetic API key (required if using Synthetic) # Get it from: https://synthetic.new/settings/api SYNTHETIC_API_KEY=syn_your_api_key_here # --- Z.ai API Configuration --- # Your Z.ai API key (required if using Z.ai) # Get it from: https://www.z.ai/api-keys ZAI_API_KEY=your_zai_api_key_here # Z.ai base URL (optional, defaults to https://api.z.ai/api) # Only change this if using a custom Z.ai endpoint ZAI_BASE_URL=https://api.z.ai/api # --- Anthropic (Claude Code) Configuration --- # Token for Anthropic usage tracking (optional) # If not set, onWatch will auto-detect from Claude Code credentials # (macOS Keychain, Linux keyring, or ~/.claude/.credentials.json) ANTHROPIC_TOKEN= # --- Codex Configuration --- # Codex OAuth access token (recommended if using Codex) # onWatch can re-read fresh tokens from ~/.codex/auth.json while running, # but setting CODEX_TOKEN in .env ensures Codex-only startup works reliably. CODEX_TOKEN= # Optional: use ChatGPT credentials stored by OpenCode for the Codex provider # OPENCODE_ENABLED=true # --- OpenCode Go Configuration --- # Track OpenCode Go subscription quotas via authenticated dashboard scrape. # Both values are required. Full walkthrough: docs/OPENCODE_SETUP.md # Workspace ID from https://opencode.ai/workspace/wrk_.../go OPENCODE_GO_WORKSPACE_ID= # Browser cookie value named "auth" from opencode.ai (value only, no auth= prefix) OPENCODE_GO_AUTH_COOKIE= # --- GitHub Copilot Configuration (Beta) --- # GitHub Personal Access Token with `copilot` scope # Required for tracking Copilot premium request usage # Generate at: https://github.com/settings/tokens (classic token, select `copilot` scope) COPILOT_TOKEN= # --- MiniMax Configuration --- # MiniMax API key for Coding Plan usage tracking # Get it from: https://platform.minimax.io (API Keys section) MINIMAX_API_KEY= # --- OpenRouter Configuration --- # OpenRouter API key for usage tracking # Get it from: https://openrouter.ai/keys OPENROUTER_API_KEY= # --- Polling Configuration --- # Interval in seconds between API polls (default: 120) # Min: 10, Max: 3600 ONWATCH_POLL_INTERVAL=120 # Idle timeout in seconds before a usage session is considered ended (default: 600) # If no API usage change is detected for this duration, the session closes. ONWATCH_SESSION_IDLE_TIMEOUT=600 # --- Web Dashboard --- # Port for the web dashboard (default: 9211) ONWATCH_PORT=9211 # --- Admin Authentication --- # Username and password for dashboard access ONWATCH_ADMIN_USER=admin ONWATCH_ADMIN_PASS=changeme # --- Database --- # Path to SQLite database file (default: ~/.onwatch/data/onwatch.db) # Leave unset to use the default. Only set this if you need a custom location. # ONWATCH_DB_PATH= # --- Logging --- # Log level: debug, info, warn, error (default: info) # In background mode (default), logs are stored in the DB directory (default: ~/.onwatch/data/) # Main daemon log: .onwatch.log (or .onwatch-test.log in --test mode) # Menubar companion log (macOS menubar builds): menubar.log (or menubar-test.log in --test mode) # Each file rotates at 50MB with 3 backups (.1, .2, .3) # In debug mode (--debug), logs go to stdout ONWATCH_LOG_LEVEL=info # Kimi Code (auto-detected from ~/.kimi-code/credentials/kimi-code.json) # KIMI_CODE_ENABLED=true # KIMI_TOKEN= # optional static access token (Docker); prefer local OAuth # KIMI_CODE_CREDENTIALS=~/.kimi-code/credentials/kimi-code.json # KIMI_CODE_BASE_URL=https://api.kimi.com/coding/v1 # KIMI_CODE_OAUTH_HOST=https://auth.kimi.com # Moonshot (Kimi) open-platform API - balance tracking (opt-in when key is set) # MOONSHOT_API_KEY= # DeepSeek platform API - balance tracking (opt-in when key is set) # DEEPSEEK_API_KEY=