Alfred402's core feature is autonomous payment processing using the x402 protocol. This page explains how the system automatically handles payments on your behalf.
Overview
Autonomous payments allow Alfred402 to:
Detect when a service requires payment (HTTP 402)
Process blockchain transactions automatically
Complete payments without manual approval
Stay within your configured spending limits
How It Works
1. Payment Detection
When you request access to a paid service, the flow works like this:
You: "Get me weather data from WeatherAPI"
↓
Alfred402 makes HTTP request to service
↓
Service returns: HTTP 402 Payment Required
↓
Alfred402 reads x402 payment details
2. Limit Verification
Before processing any payment, Alfred402 checks:
Daily Spending Limit: Have you exceeded today's limit?
Weekly Spending Limit: Have you exceeded this week's limit?
Monthly Spending Limit: Have you exceeded this month's limit?
Single Transaction Limit: Is this payment within acceptable range?
If any limit would be exceeded, the payment is rejected and you're notified.
3. Automatic Processing
If limits check out:
4. Service Access
Once payment is confirmed:
Total time: ~3-5 seconds from request to delivery!
Payment Types Supported
Native Token Payments
Pay with the blockchain's native currency:
Ethereum: ETH
Solana: SOL
Polygon: MATIC
Base: ETH
ERC20 Token Payments
Pay with standard tokens:
USDC, USDT, DAI
Custom x402 tokens
Service-specific tokens
Multi-Chain Support
Alfred402 is blockchain agnostic:
Automatically detects required chain
Uses appropriate wallet connection
Handles gas fees correctly per chain
Payment Flow Example
Here's a real-world example:
Security Features
Spending Limits
You maintain full control with configurable limits:
Transaction Transparency
Every payment is:
✅ Recorded on-chain (publicly verifiable)
✅ Displayed with transaction hash
✅ Includes service details
✅ Shows exact costs
Non-Custodial
You control your private keys
Alfred402 never holds your funds
All transactions signed by your wallet
Revoke access anytime
Payment States
Payments go through these states:
Pending - Transaction submitted to blockchain
Confirming - Waiting for block confirmation
Completed - Payment confirmed, service accessed
Failed - Transaction reverted or rejected
Refunded - Service failed to deliver, funds returned
Gas Fees
What Are Gas Fees?
Gas fees are transaction costs paid to blockchain validators:
1. Alfred402 constructs blockchain transaction
2. Signs transaction with authorized wallet
3. Submits to blockchain network
4. Waits for confirmation (~2 seconds)
5. Receives payment proof (transaction hash)
1. Alfred402 retries original request
2. Includes payment proof in headers
3. Service validates payment
4. Returns requested data
5. Alfred402 presents results to you
User: "I need AI-generated images of a sunset over mountains"
Alfred402: "Found: Heurist Mesh AI Image Generation"
"Cost: 0.001 ETH (~$2.50)"
"Checking spending limits..."
"✓ Within daily limit (0.01 ETH)"
"✓ Within weekly limit (0.05 ETH)"
"Processing payment..."
"✓ Transaction submitted: 0x1234..."
"✓ Confirmed in 2.1 seconds"
"Accessing service..."
"✓ Images generated successfully"
[AI-generated images displayed]
Transaction details:
- Amount: 0.001 ETH
- Gas: 0.00015 ETH
- Total: 0.00115 ETH
- Tx: 0x1234...abcd
❌ Service temporarily unavailable
⟳ Retrying in 5 seconds...
✓ Retry successful!
❌ Insufficient balance
Required: 0.01 ETH
Balance: 0.005 ETH
💡 Add funds to continue
❌ Daily spending limit exceeded
Limit: 0.01 ETH
Spent today: 0.01 ETH
💡 Increase limits or wait until tomorrow
❌ Transaction failed
Reason: Gas price too low
⟳ Retry with higher gas? [Yes] [No]
Recent Payments
───────────────────────────────────────
🟢 WeatherAPI 0.001 ETH 2 min ago
🟢 Heurist Mesh 0.002 ETH 15 min ago
🟢 IPFS Pin 0.0005 ETH 1 hr ago
🔴 DataAPI Failed 2 hr ago
───────────────────────────────────────
Total Today: 0.0035 ETH
✅ Daily: 0.01 ETH
✅ Weekly: 0.05 ETH
✅ Monthly: 0.2 ETH
Current: Daily 0.01 ETH
Usage: 0.015 ETH attempted
Action: Increase to 0.02 ETH or wait