Configuration Reference¶
MeterBase is configured via environment variables, typically set in a .env file at the project root. This page documents every available variable.
Core Settings¶
| Variable | Required | Default | Description |
|---|---|---|---|
SECRET_KEY |
Yes | -- | Secret key for JWT signing and session encryption. Must be at least 32 characters. |
ENVIRONMENT |
No | development |
Runtime environment. One of development, staging, production. |
DEBUG |
No | false |
Enable debug mode. Never enable in production. |
LOG_LEVEL |
No | INFO |
Logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL. |
ALLOWED_HOSTS |
No | * |
Comma-separated list of allowed hostnames. Set explicitly in production. |
CORS_ORIGINS |
No | http://localhost:3000 |
Comma-separated list of allowed CORS origins. |
Production Security
In production, always set SECRET_KEY to a cryptographically random value, set DEBUG=false, and restrict ALLOWED_HOSTS and CORS_ORIGINS to your actual domains.
Database¶
MeterBase uses PostgreSQL as its primary datastore. In production, MeterBase is deployed with Neon Postgres (serverless). For local development, a standard PostgreSQL instance works fine.
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL |
Yes | -- | PostgreSQL connection string. Format: postgresql://user:password@host:port/dbname |
DATABASE_POOL_SIZE |
No | 10 |
Connection pool size. Increase for high-traffic deployments. |
DATABASE_MAX_OVERFLOW |
No | 20 |
Maximum overflow connections beyond pool size. |
DATABASE_ECHO |
No | false |
Log all SQL queries. Useful for debugging, noisy in production. |
Example (local):
DATABASE_URL=postgresql://meterbase:securepassword@localhost:5432/meterbase
DATABASE_POOL_SIZE=20
DATABASE_MAX_OVERFLOW=40
Example (Neon Postgres -- production):
DATABASE_URL=postgresql://meterbase:password@ep-cool-name-123456.us-east-2.aws.neon.tech/meterbase?sslmode=require
Neon Postgres
Neon provides serverless Postgres with auto-scaling, branching, and connection pooling. The ?sslmode=require parameter is required for Neon connections. See the Deployment Guide for full Neon setup instructions.
Redis¶
| Variable | Required | Default | Description |
|---|---|---|---|
REDIS_URL |
Yes | -- | Redis connection string. Format: redis://host:port/db |
REDIS_CACHE_TTL |
No | 3600 |
Default cache TTL in seconds (1 hour). |
Example:
AI and LLM¶
MeterBase uses Anthropic Claude for AI-powered features including bill analysis, tariff extraction, and natural language comparisons.
| Variable | Required | Default | Description |
|---|---|---|---|
ANTHROPIC_API_KEY |
Yes* | -- | Anthropic API key for Claude. Required for AI features. |
ANTHROPIC_MODEL |
No | claude-sonnet-4-20250514 |
Claude model to use. |
ANTHROPIC_MAX_TOKENS |
No | 4096 |
Maximum tokens per AI request. |
AI_BILL_ANALYSIS_ENABLED |
No | true |
Enable/disable AI bill analysis. |
AI_TARIFF_EXTRACTION_ENABLED |
No | true |
Enable/disable AI tariff extraction from PDFs. |
AI Features Are Optional
If ANTHROPIC_API_KEY is not set, AI features are disabled but all other functionality works normally. Bills can still be entered manually.
External Data APIs¶
These keys are used by the tariff import pipeline to fetch utility and rate data.
| Variable | Required | Default | Description |
|---|---|---|---|
OPENEI_API_KEY |
Yes* | -- | OpenEI API key for tariff rate data. Required for tariff import. |
EIA_API_KEY |
Yes* | -- | EIA (Energy Information Administration) API key for utility directory data. |
Getting API Keys
- OpenEI: Register at openei.org/services for a free API key.
- EIA: Register at eia.gov/opendata for a free API key.
Stripe Billing¶
MeterBase uses Stripe for subscription management, checkout, and usage-based billing enforcement.
| Variable | Required | Default | Description |
|---|---|---|---|
STRIPE_SECRET_KEY |
Yes* | -- | Stripe secret API key. Required for billing features. |
STRIPE_PUBLISHABLE_KEY |
Yes* | -- | Stripe publishable key for frontend checkout. |
STRIPE_WEBHOOK_SECRET |
Yes* | -- | Webhook signing secret for verifying inbound Stripe events. |
STRIPE_PRO_PRICE_ID |
Yes* | -- | Stripe Price ID for the Pro tier subscription. |
Stripe Is Optional for Development
If Stripe keys are not configured, billing endpoints return errors but the rest of the platform functions normally. Free tier limits are still enforced.
Propexo Integration¶
For connecting to property management systems (Yardi, RealPage, etc.) via Propexo.
| Variable | Required | Default | Description |
|---|---|---|---|
PROPEXO_API_KEY |
No | -- | Propexo API key for PMS integration. |
PROPEXO_BASE_URL |
No | https://api.propexo.com |
Propexo API base URL. |
PROPEXO_WEBHOOK_SECRET |
No | -- | Shared secret for verifying inbound Propexo webhooks. |
PROPEXO_SYNC_INTERVAL |
No | 3600 |
Automatic sync interval in seconds (1 hour). Set to 0 to disable. |
PROPEXO_CHARGE_POSTING_ENABLED |
No | false |
Enable pushing RUBS charges back to the PMS. Enable only after testing. |
PROPEXO_ORGANIZATION_ID |
No | -- | Propexo organization identifier for multi-org setups. |
Charge Posting
Enable PROPEXO_CHARGE_POSTING_ENABLED only after you have verified that charge calculations are correct in a test environment. Incorrect charges posted to your PMS can affect tenant billing.
Authentication¶
| Variable | Required | Default | Description |
|---|---|---|---|
JWT_ALGORITHM |
No | HS256 |
JWT signing algorithm. |
JWT_EXPIRATION_HOURS |
No | 24 |
JWT token expiration time in hours. |
PASSWORD_MIN_LENGTH |
No | 8 |
Minimum password length for user accounts. |
MAX_LOGIN_ATTEMPTS |
No | 5 |
Maximum failed login attempts before account lockout. |
LOCKOUT_DURATION_MINUTES |
No | 30 |
Account lockout duration after max failed attempts. |
Rate Limits¶
MeterBase enforces rate limits per API key based on subscription tier.
Tier Limits¶
| Tier | Requests/Minute | Requests/Hour | AI Requests/Day | Properties | Portfolios |
|---|---|---|---|---|---|
| Free | 30 | 500 | 10 | 5 | 1 |
| Pro | 120 | 5,000 | 200 | 100 | 10 |
| Enterprise | 600 | 50,000 | Unlimited | Unlimited | Unlimited |
Rate Limit Configuration¶
| Variable | Required | Default | Description |
|---|---|---|---|
RATE_LIMIT_ENABLED |
No | true |
Enable/disable rate limiting globally. |
RATE_LIMIT_STORAGE |
No | redis |
Storage backend for rate limit counters. redis or memory. |
RATE_LIMIT_DEFAULT_TIER |
No | free |
Default tier for new API keys. |
Rate limit headers are included in every API response:
File Upload¶
| Variable | Required | Default | Description |
|---|---|---|---|
MAX_UPLOAD_SIZE_MB |
No | 25 |
Maximum file upload size in megabytes. |
UPLOAD_STORAGE |
No | local |
File storage backend: local or s3. |
UPLOAD_DIR |
No | ./uploads |
Local upload directory (when UPLOAD_STORAGE=local). |
AWS_S3_BUCKET |
No | -- | S3 bucket name (when UPLOAD_STORAGE=s3). |
AWS_ACCESS_KEY_ID |
No | -- | AWS access key for S3. |
AWS_SECRET_ACCESS_KEY |
No | -- | AWS secret key for S3. |
AWS_REGION |
No | us-east-1 |
AWS region for S3 bucket. |
Frontend¶
These variables are used by the Next.js frontend and must be prefixed with NEXT_PUBLIC_ to be accessible in the browser.
| Variable | Required | Default | Description |
|---|---|---|---|
NEXT_PUBLIC_API_URL |
No | http://localhost:8000 |
Backend API URL for the frontend to call. |
NEXT_PUBLIC_APP_NAME |
No | MeterBase |
Application name displayed in the UI. |
NEXT_PUBLIC_SUPPORT_EMAIL |
No | -- | Support email shown in the UI. |
Example .env File¶
# Core
SECRET_KEY=your-64-char-random-string-here
ENVIRONMENT=production
DEBUG=false
LOG_LEVEL=INFO
ALLOWED_HOSTS=meterbase.yourcompany.com
CORS_ORIGINS=https://meterbase.yourcompany.com
# Database
DATABASE_URL=postgresql://meterbase:securepassword@db:5432/meterbase
DATABASE_POOL_SIZE=20
# Redis
REDIS_URL=redis://redis:6379/0
# AI
ANTHROPIC_API_KEY=sk-ant-api03-...
# Data Sources
OPENEI_API_KEY=your-openei-key
EIA_API_KEY=your-eia-key
# Propexo
PROPEXO_API_KEY=your-propexo-key
PROPEXO_WEBHOOK_SECRET=your-webhook-secret
PROPEXO_CHARGE_POSTING_ENABLED=false
# Stripe
STRIPE_SECRET_KEY=sk_live_...
STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
STRIPE_PRO_PRICE_ID=price_...
# Frontend
NEXT_PUBLIC_API_URL=https://app.meterbase.io/api