How It Works
Technical flow of the x402 payment protocol
The Query Flow
Step 1: Agent Discovers Endpoint
Step 2: Initial Request
GET /x402/query?q=prediction+markets+mana HTTP/1.1
Host: your-atlas.example.comStep 3: Payment Required Response
HTTP/1.1 402 Payment Required
X-Payment-Amount: 0.01
X-Payment-Currency: USDC
X-Payment-Network: solana
X-Payment-Address: <solana-wallet-address>
X-Payment-Memo: query-<unique-id>
Content-Type: application/json
{
"status": "payment_required",
"amount": "0.01",
"currency": "USDC",
"network": "solana",
"payment_address": "<address>",
"memo": "query-abc123",
"preview": "Found 15 concepts related to prediction markets...",
"expires": "2024-01-15T12:00:00Z"
}Step 4: Payment Submission
Step 5: Payment Verification
Step 6: Knowledge Delivery
Payment Flow Diagram
Technical Components
Payment Verification Module
Pricing Engine
Factor
Impact
Caching Layer
Security Considerations
For Knowledge Providers
For Knowledge Consumers
API Reference
Query Endpoint
Payment Status
Knowledge Domains
Integration Examples
Python Client
Agent Integration
Last updated
