Skip to main content
This page documents all environment variables used across ouroborai applications. Required variables are marked with an asterisk (*).

API Server (apps/api/)

VariableRequiredDefaultDescription
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_URLRedis 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_KEYPimlico bundler API key for ERC-4337 operations
ALCHEMY_API_KEYAlchemy API key for NFT data and enhanced RPC
API_KEYSPre-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:
VariableDescription
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/)

VariableRequiredDefaultDescription
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/)

VariableRequiredDefaultDescription
TELEGRAM_BOT_TOKEN*Bot token from @BotFather
API_URLhttp://localhost:3000Backend API server URL
API_KEYAPI key for authenticated endpoints

Twitter Bot

VariableRequiredDefaultDescription
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

VariableRequiredDefaultDescription
API_URLhttp://localhost:3000Backend API server URL
API_KEYAPI key for authenticated endpoints

MCP Server (apps/mcp-server/)

VariableRequiredDefaultDescription
PRIVATE_KEY*Wallet private key for on-chain operations
ARB_RPC_URLArbitrum public RPCArbitrum 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:
PrefixTTLDescription
arb:job:{id}NoneJob queue entries (pending, running, complete)
arb:thread:{id}NoneConversation thread state and messages
arb:nonce:{nonce}24 hoursx402 payment nonce deduplication
arb:revenue:totalNoneRunning total of USDC revenue
arb:revenue:day:{YYYY-MM-DD}90 daysDaily revenue hash (count + total)
arb:revenue:recentNoneLast 1000 payment records (capped list)
arb:revenue:payersNoneSet of unique payer addresses
arb:apikey:{hash}NoneAPI key entries (hashed)

Example .env Files

# 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.