Enable route-based gateway mode. When set, paid top-level routes can be called directly: Key0 returns a 402 challenge, proxies the request to this base URL after payment, and returns a ResourceResponse. ISSUE_TOKEN_API is not called for route purchases.
Private key of an ETH-funded wallet for self-contained on-chain settlement. Alternative to using the CDP (Coinbase Developer Platform) facilitator.
KEY0_WALLET_PRIVATE_KEY
No
—
Private key of the receiving wallet. Required only if you run the refund cron.
REFUND_INTERVAL_MS
No
60000
How often the refund cron scans for refundable challenges, in milliseconds.
REFUND_MIN_AGE_MS
No
300000
Grace period before a paid-but-undelivered challenge becomes eligible for refund, in milliseconds.
REFUND_BATCH_SIZE
No
50
Maximum number of refunds processed per cron tick.
When you embed Key0 via createKey0() or a framework integration, you supply most configuration through the SellerConfig object in code. The variables below are commonly read from the environment.
Variable
Required
Default
Description
KEY0_NETWORK
Yes
—
mainnet (Base) or testnet (Base Sepolia).
KEY0_WALLET_ADDRESS
Yes
—
USDC-receiving wallet address (0x...).
ACCESS_TOKEN_SECRET
Yes
—
Secret used to sign access-grant JWTs. Must be at least 32 characters.
REDIS_URL
No
—
Redis connection URL for challenge and seen-tx stores.
DATABASE_URL
No
—
PostgreSQL connection URL (if using Postgres stores).
PORT
No
3000
Server listen port.
CDP_API_KEY_ID
No
—
Coinbase Developer Platform facilitator API key ID.
CDP_API_KEY_SECRET
No
—
Coinbase Developer Platform facilitator API key secret.
GAS_WALLET_PRIVATE_KEY
No
—
Private key of an ETH-funded wallet for self-contained settlement. Alternative to CDP facilitator.
KEY0_WALLET_PRIVATE_KEY
No
—
Private key of the receiving wallet. Required only if you run the refund cron.
ACCESS_TOKEN_SECRET must be at least 32 characters. Shorter values cause JWT signing to fail at startup.
KEY0_WALLET_PRIVATE_KEY is only needed if you enable the refund cron. For normal operation, only the public wallet address is required.
GAS_WALLET_PRIVATE_KEY provides an alternative to the CDP facilitator for on-chain settlement. The wallet must hold enough ETH on Base to cover gas fees.
Redis is required even when you select Postgres as the storage backend. The BullMQ-based refund cron and distributed gas-wallet lock both depend on Redis.