Monetization

Treasury, fees, and API paywall.

Treasury

Set treasuryAddress in ~/.aep/config.json or AEP_TREASURY_ADDRESS env. Revenue flows to this address.

API Paywall

When AEP_TREASURY_ADDRESS (or treasuryAddress in config) is set, POST /resolve and POST /resolve/premium are paywalled.

AEP_PAYWALL_BACKENDBehavior
x402 or unset (default)x402-hono on Base (AEP_NETWORK: base / base-sepolia)
mppMachine Payments Protocol — Tempo session via mppx (mppx/hono). Single channel + per-request voucher increments; settlement on Tempo.

Only one backend is active at a time. MPP requires a strong server secret and Tempo configuration (see below).

PathPaywallUse case
REST POST /resolveYes, when treasury setAny API instance you or a provider runs with treasury configured
MCP (resolve_intent)NoLocal resolver in the MCP process
CLI (aep resolve)NoLocal resolver. aep resolve --api-url <url> hits a remote API (x402 or MPP, depending on server and AEP_PAYWALL_BACKEND / response headers)

MPP / Tempo (API server)

VariableDescription
MPP_SECRET_KEY or AEP_MPP_SECRET_KEYRequired when AEP_PAYWALL_BACKEND=mpp; use a long random value (e.g. openssl rand -hex 32)
AEP_TEMPO_CHAIN_ID4217 mainnet (default), 42431 Moderato testnet
AEP_TEMPO_RPC_URLTempo JSON-RPC (overrides default public RPC for the chosen chain)
AEP_TEMPO_CURRENCYTIP-20 token address (defaults: mainnet USDC, testnet pathUSD per mppx defaults)
AEP_TEMPO_ESCROW_CONTRACTTempoStreamChannel address (defaults documented for 4217 / 42431 on mpp.dev)
AEP_TEMPO_SUGGESTED_DEPOSITHuman-readable suggested channel deposit for sessions (default 5)
AEP_TEMPO_FEE_PAYER_URL or AEP_TEMPO_FEE_PAYER_PRIVATE_KEYOptional server-side fee sponsorship (API process only; never log keys)

Optional ~/.aep/config.json (non-secret defaults): tempoRpcUrl, tempoChainId, tempoCurrency, tempoEscrowContract. When the same knob is set in env (AEP_TEMPO_*), env wins. The hosted API reads these at startup; aep resolve --api-url uses tempoRpcUrl / tempoChainId when opening the MPP client if env is unset.

AEP policy checks (checkPolicy / BudgetPolicy) still run against your Base AEP account when you use the SDK or CLI hooks; they do not observe Tempo settlement automatically (same limitation as x402).

Resolution Prices

VariableDefaultDescription
AEP_RESOLVE_PRICE$0.005Standard tier
AEP_RESOLVE_PRICE_PREMIUM$0.02Premium tier

Relationship Fees

ContractFee paramPayer
CreditFacility--origination-feeLender
ConditionalEscrow--setup-feeCaller
SLAContract--setup-feeCaller

Use 0 for no fee. Fee-free mode: deploy relationship factories with AEP_TREASURY_ADDRESS unset.

Revenue Flow

x402 or MPP (Tempo session) per resolve (POST /resolve)  ──→ AEP Treasury
Credit facility origination fee                          ──→ AEP Treasury
Escrow setup fee                                         ──→ AEP Treasury
SLA contract setup fee                                   ──→ AEP Treasury