This page documents all environment variables used across ouroborai
applications. Required variables are marked with an asterisk (*).
API Server (apps/api/)
Variable Required Default Description PRIVATE_KEY* — Wallet private key for on-chain operations (hex, starts with 0x) ANTHROPIC_API_KEY* — Anthropic API key for the Claude-backed agent runner ARB_RPC_URL* — Arbitrum One JSON-RPC URL (Alchemy, Infura, or public) PORT3000HTTP server port REDIS_URL— Redis connection URL for persistent state PAY_TO_ADDRESS0x000...000USDC recipient address for x402 payments SKIP_PAYMENTfalseSet to true to disable x402 payment verification CORS_ORIGIN* (all origins)Comma-separated allowed CORS origins PIMLICO_API_KEY— Pimlico bundler API key for ERC-4337 operations ALCHEMY_API_KEY— Alchemy API key for NFT data and enhanced RPC API_KEYS— Pre-seeded API keys (used in testing/staging)
Never commit PRIVATE_KEY or ANTHROPIC_API_KEY to version control. The
.env file in apps/api/ is excluded by .gitignore.
x402 Payment Variables
The x402 middleware uses these variables for micropayment verification:
Variable Description PAY_TO_ADDRESSThe address that receives USDC payments SKIP_PAYMENTBypass payment checks in development
When REDIS_URL is set, x402 nonces are tracked in Redis with the key
pattern arb:nonce:{nonce} and a 24-hour TTL to prevent replay attacks.
Web App (apps/web/)
Variable Required Default Description NEXT_PUBLIC_API_URL* http://localhost:3000Backend API server URL NEXT_PUBLIC_DYNAMIC_ENV_ID* — Dynamic wallet connection environment ID
Both variables use the NEXT_PUBLIC_ prefix because they are accessed in
client-side React code.
The web app inlines types from @arb-agent/sdk to avoid importing
Node.js-only modules into the browser bundle. The API URL is the only
required connection between the web app and the backend.
Telegram Bot (apps/telegram/)
Variable Required Default Description TELEGRAM_BOT_TOKEN* — Bot token from @BotFather API_URLhttp://localhost:3000Backend API server URL API_KEY— API key for authenticated endpoints
Variable Required Default Description TWITTER_API_KEY* — Twitter/X API key TWITTER_API_SECRET* — Twitter/X API secret TWITTER_ACCESS_TOKEN* — OAuth access token TWITTER_ACCESS_SECRET* — OAuth access secret API_URLhttp://localhost:3000Backend API server URL
CLI
Variable Required Default Description API_URLhttp://localhost:3000Backend API server URL API_KEY— API key for authenticated endpoints
MCP Server (apps/mcp-server/)
Variable Required Default Description PRIVATE_KEY* — Wallet private key for on-chain operations ARB_RPC_URLArbitrum public RPC Arbitrum One JSON-RPC URL
The .mcp.json configuration file contains PRIVATE_KEY in plaintext.
It is excluded from version control by .gitignore but exercise caution
when sharing your project directory.
Redis Key Prefixes
When REDIS_URL is configured, the API server uses these key patterns:
Prefix TTL Description arb:job:{id}None Job queue entries (pending, running, complete) arb:thread:{id}None Conversation thread state and messages arb:nonce:{nonce}24 hours x402 payment nonce deduplication arb:revenue:totalNone Running total of USDC revenue arb:revenue:day:{YYYY-MM-DD}90 days Daily revenue hash (count + total) arb:revenue:recentNone Last 1000 payment records (capped list) arb:revenue:payersNone Set of unique payer addresses arb:apikey:{hash}None API key entries (hashed)
Example .env Files
apps/api/.env
apps/web/.env.local
apps/telegram/.env
# Required
PRIVATE_KEY = 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
ANTHROPIC_API_KEY = sk-ant-api03-XXXXXXXXXXXX
ARB_RPC_URL = https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY
# Optional
REDIS_URL = redis://localhost:6379
PORT = 3000
PAY_TO_ADDRESS = 0xYourRevenueAddress
SKIP_PAYMENT = true
CORS_ORIGIN = http://localhost:3001
ALCHEMY_API_KEY = YOUR_ALCHEMY_KEY
Copy the .env.example files included in each app directory as a starting
point. They list all supported variables with placeholder values.