Skip to main content

API Configuration

Configuration is loaded from TOML files with APP_ environment variable overrides.

Config files

PathUsage
config/default.tomlLocal / standalone API
config/api/default.tomlclutch-deploy Docker mount
config/{env}.tomlEnvironment-specific (via --env flag)

Environment variables use the APP_ prefix: APP_LOG_LEVEL=debug maps to log_level.

Key settings

SettingDescriptionExample
ws_addrAPI HTTP bind address0.0.0.0:3000
serve_metric_addrPrometheus metrics bind0.0.0.0:9090
clutch_node_ws_urlNode WebSocket URLws://node1:8081/ws
seq_urlSeq logging URLhttp://seq:80
seq_api_keySeq API key""
jwt_secretJWT signing secretChange in production
jwt_expiration_hoursToken lifetime (hours)6
log_levelLogging levelinfo
faucet_enabledEnable POST /faucettrue (testnet)
faucet_private_keyFaucet signing keyhex secp256k1
faucet_amount_cltCLT per faucet request1000
default_ride_request_referrerInjected referrer on requestsaddress or empty
default_ride_offer_referrerInjected referrer on offersaddress or empty

Environment overrides

APP_CLUTCH_NODE_WS_URL=ws://localhost:8081/ws
APP_JWT_SECRET=your-production-secret
APP_FAUCET_ENABLED=false

Docker (clutch-deploy)

The API container mounts config/api/default.toml. Override via .env in clutch-deploy:

JWT_SECRET=change-me-in-production
ALLOWED_ORIGINS=http://localhost:5173

Production checklist

  • Set strong jwt_secret
  • Disable faucet (faucet_enabled = false)
  • Configure CORS / ALLOWED_ORIGINS
  • Use HTTPS via nginx reverse proxy
  • Set SEQ_API_KEY if Seq is exposed

See Security and Deployment.