Copy backend/.env.example and frontend/.env.example when running locally. Never commit real secrets.
# Generate secrets (example)
python -c "import secrets; print(secrets.token_hex(32))" # ENCRYPTION_KEY
python -c "import secrets; print(secrets.token_urlsafe(32))" # JWT_SECRET
Backend variables
| Variable | Required | Default | Description |
|---|
| OPENAI_API_KEY | Yes | — | API key for the LLM provider used by chat orchestration |
| OPENAI_BASE_URL | No | https://api.openai.com/v1 | OpenAI-compatible API base URL |
| OPENAI_MODEL | No | — | Model identifier passed to the chat completion API |
| OPENAI_TEMPERATURE | No | 0.3 | Sampling temperature for chat completions |
| OPENAI_MAX_TOKENS | No | 768 | Max completion tokens per chat turn |
| CHAT_HISTORY_LIMIT | No | 10 | Number of prior messages included in LLM context |
| ENCRYPTION_KEY | Yes | — | 32-byte key for AES-256 encryption of agent wallet keys |
| JWT_SECRET | Yes | — | Secret for signing agent access tokens |
| DATABASE_PATH | No | ./data/pocketagent.db | SQLite database file path (absolute recommended in production) |
| CORS_ORIGINS | No | http://localhost:3000 | Comma-separated allowed frontend origins |
| POCKET_RPC_URL | No | — | Default Pocket Network RPC gateway URL |
| COINGECKO_API_URL | No | https://api.coingecko.com/api/v3 | CoinGecko API base for portfolio valuations |
| COINGECKO_API_KEY | No | — | Optional CoinGecko Pro API key |
| CACHE_TTL_BALANCE | No | 300 | Balance cache TTL in seconds |
| CACHE_TTL_GAS | No | 30 | Gas price cache TTL in seconds |
| NOTIONAL_POKT_PER_RELAY | No | 0.00089 | Notional POKT cost estimate per relay for analytics |
| DISABLE_AGENT_AUTH | No | false | Skip token checks in local dev only — never enable in production |
Frontend variables
| Variable | Required | Default | Description |
|---|
| NEXT_PUBLIC_API_URL | Yes | — | Backend API base URL (no trailing slash) |
| NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID | Yes | — | WalletConnect Cloud project ID for RainbowKit |
| NEXT_PUBLIC_DISABLE_AGENT_AUTH | No | false | Mirror backend DISABLE_AGENT_AUTH for local UI dev |
MCP server variables
| Variable | Required | Default | Description |
|---|
| OPENAI_API_KEY | Yes | — | Required when MCP tools invoke LLM-backed flows |
| ENCRYPTION_KEY | Yes | — | Required for write tools that sign with agent wallets |
| JWT_SECRET | Yes | — | Required to validate agent access tokens on protected tools |
| DATABASE_PATH | No | ./data/pocketagent.db | SQLite path for agent rows; use absolute path when installed via pip |