Introducing x402

HTTP Payments for AI Agents

Bringing payments directly into HTTP. Your AI agents can now pay for APIs, data, and services—instantly and programmatically.

HTTP Request Flow
// 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.

OpenAI

GPT-4

$0.01

Most capable model for complex reasoning and creative tasks

Complex reasoningCode generationCreative writing
Endpoint
/api/llm/openai/gpt-4
Example Request
curl -X POST https://x402.luna.dev/api/llm/openai/gpt-4 \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Explain quantum computing",
    "max_tokens": 500
  }'
Anthropic

Claude 3.5 Sonnet

$0.01

Excellent for analysis, research, and long-form content

AnalysisResearchLong-form content
Endpoint
/api/llm/anthropic/claude-3.5-sonnet
Example Request
curl -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
  }'
Google

Gemini Pro

$0.01

Fast and efficient for general-purpose tasks

SummarizationQ&AGeneral tasks
Endpoint
/api/llm/google/gemini-pro
Example Request
curl -X POST https://x402.luna.dev/api/llm/google/gemini-pro \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Summarize this article",
    "max_tokens": 300
  }'
Meta

Llama 3.1

$0.01

Open-source model for diverse applications

Content generationChatbotsClassification
Endpoint
/api/llm/meta/llama-3.1
Example Request
curl -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 AI

Mistral Large

$0.01

High-performance European model for enterprise use

TranslationEnterprise tasksMultilingual
Endpoint
/api/llm/mistral/mistral-large
Example Request
curl -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
  }'
Cohere

Command R+

$0.01

Optimized for RAG and enterprise search

RAGSearchInformation retrieval
Endpoint
/api/llm/cohere/command-r-plus
Example Request
curl -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
  }'

Interactive API Sandbox

This is a simulated demo. Real x402 payments happen on-chain with actual USDC transfers.

How x402 Works

STEP 01

Request

AI agent makes an HTTP request to a paid endpoint

💳
STEP 02

402 Response

Server returns payment details and required amount

STEP 03

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