HTTP Payments for AI Agents
Bringing payments directly into HTTP. Your AI agents can now pay for APIs, data, and services—instantly and programmatically.
// 1. Agent requests premium data
GET /api/premium-data
// 2. Server responds with 402 Payment Required
{
"status": 402,
"message": "Payment required",
"price": "0.01",
"currency": "USDC",
"recipient": "lunar_wallet_xyz",
"request_id": "req_abc123"
}
// 3. Agent pays instantly
→ Payment sent: 0.01 USDC
// 4. Agent retries with proof
GET /api/premium-data
X-Payment-Tx: tx_hash_def456
// 5. Data delivered ✓Available LLM Endpoints
Access premium AI models with instant x402 payments. All calls cost just $0.01 per request.
GPT-4
Most capable model for complex reasoning and creative tasks
/api/llm/openai/gpt-4curl -X POST https://x402.luna.dev/api/llm/openai/gpt-4 \
-H "Content-Type: application/json" \
-d '{
"prompt": "Explain quantum computing",
"max_tokens": 500
}'Claude 3.5 Sonnet
Excellent for analysis, research, and long-form content
/api/llm/anthropic/claude-3.5-sonnetcurl -X POST https://x402.luna.dev/api/llm/anthropic/claude-3.5-sonnet \
-H "Content-Type: application/json" \
-d '{
"prompt": "Analyze this dataset",
"max_tokens": 1000
}'Gemini Pro
Fast and efficient for general-purpose tasks
/api/llm/google/gemini-procurl -X POST https://x402.luna.dev/api/llm/google/gemini-pro \
-H "Content-Type: application/json" \
-d '{
"prompt": "Summarize this article",
"max_tokens": 300
}'Llama 3.1
Open-source model for diverse applications
/api/llm/meta/llama-3.1curl -X POST https://x402.luna.dev/api/llm/meta/llama-3.1 \
-H "Content-Type: application/json" \
-d '{
"prompt": "Generate product descriptions",
"max_tokens": 400
}'Mistral Large
High-performance European model for enterprise use
/api/llm/mistral/mistral-largecurl -X POST https://x402.luna.dev/api/llm/mistral/mistral-large \
-H "Content-Type: application/json" \
-d '{
"prompt": "Translate and localize content",
"max_tokens": 500
}'Command R+
Optimized for RAG and enterprise search
/api/llm/cohere/command-r-pluscurl -X POST https://x402.luna.dev/api/llm/cohere/command-r-plus \
-H "Content-Type: application/json" \
-d '{
"prompt": "Search and retrieve information",
"max_tokens": 600
}'Live x402 API Sandbox
Connect Wallet
Connect your Solana wallet to make real x402 payments and access GPT-4 via our protocol.
Live Demo: This sandbox makes real API calls to OpenAI GPT-4 using the x402 payment protocol. Each request costs 0.01 SOL. For testing purposes, payment verification is simplified—in production, full Solana blockchain verification would be implemented.
How x402 Works
Request
AI agent makes an HTTP request to a paid endpoint
402 Response
Server returns payment details and required amount
Instant Pay
Agent pays programmatically, gets data immediately
Built for the Agent Economy
No Accounts Needed
Agents can't fill out forms or create accounts. x402 enables pure programmatic payments.
Instant Settlement
Payments settle in seconds on-chain. No waiting, no chargebacks, no fraud.
Micropayment Ready
Pay $0.001 for a single API call. Finally economical for small transactions.
Agent-Native
Built for AI assistants, research bots, and autonomous workflows talking to each other.
See It In Action
Watch a simulated AI agent make a paid HTTP request using x402
Launch Interactive Demo