x402 paywalls
x402 paywalls let you charge visitors a small amount to access a claimed site for a configured duration. ATTIM uses the x402 payment protocol with EVM wallets.
How it works
- You configure one EVM payout address per supported network in your account.
- You enable a paywall on a claimed site with a price in USD and an access duration.
- Visitors to the site see an x402 wallet payment screen.
- After payment, the visitor receives an access cookie scoped to the slug domain.
- The cookie lasts for the configured
accessDurationSeconds, after which the visitor must pay again. - Each site accepts one selected x402 network at a time.
Supported networks
ATTIM supports x402 networks using CAIP-2 identifiers. The default network is configured server-side; common values include eip155:8453 (Base).
Use GET /api/payment/wallets to see supported networks and the default.
Setting a payment wallet
Before enabling a paywall, you must configure a payout address for the network you intend to use.
CLI
npx attim wallet set 0x0000000000000000000000000000000000000001 --network eip155:8453Check your wallet:
npx attim wallet --network eip155:8453Clear a wallet:
npx attim wallet clear --network eip155:8453API
curl -X PUT https://attim.link/api/payment/wallet \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"network":"eip155:8453","address":"0x..."}'Clear:
curl -X PUT https://attim.link/api/payment/wallet \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"network":"eip155:8453","address":null}'MCP
Use set_payment_wallet with network and address. Pass address: null to clear.
Enabling a paywall
CLI
npx attim paywall enable my-site 0.25 --network eip155:8453 --access-ttl 864000.25is the price in USD (25 cents).--networkdefaults to the server default if omitted.--access-ttlcontrols how long payment access lasts, in seconds.
API
curl -X PATCH https://attim.link/api/publish/my-site/paywall \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled":true,"network":"eip155:8453","priceUsd":"0.25","accessDurationSeconds":86400}'MCP
Use the set_paywall tool with enabled: true, priceUsd, optional network, and optional accessDurationSeconds.
Disabling a paywall
CLI
npx attim paywall disable my-site --network eip155:8453API
curl -X PATCH https://attim.link/api/publish/my-site/paywall \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled":false,"network":"eip155:8453"}'MCP
Use the set_paywall tool with enabled: false.
Changing price or network
Run the enable command again with new values. The change takes effect immediately; live hosted-site responses use Cache-Control: no-store so paywall changes are not cached.
Limitations
- Paywalls require claimed sites; anonymous sites cannot use x402 paywalls.
- Only one network can be active per site at a time.
- API and agent requests to a paywalled site receive a machine-readable
PAYMENT-REQUIREDchallenge instead of the payment screen. - If both password protection and paywall are enabled, visitors enter the password first, then see the payment flow.
