Agentic Commerce · x402 Protocol

Machine-Readable HTTP 402 / x402 & Agentic Commerce Discovery

Advertise machine-payable agent capabilities in A2A agent-card.json and MCP endpoints using HTTP 402 Payment Required (x402), cryptographic payment requirements, and strict secret-safety controls.

Manifest Parameters

Zero Telemetry · Strict CSP
Authentication & OAuth Scopes
A2A Agent Card (v0.3) Options
Exact Well-Known Endpoint URL application/json
https://agent.example.com/.well-known/agent-card.json
/.well-known/agent-card.json
{
  "protocolVersion": "0.3.0",
  "name": "Paid Research Agent (x402)",
  "description": "Pay-per-call market intelligence agent accepting HTTP 402 x402 stablecoin settlement.",
  "url": "https://agent.example.com/a2a",
  "preferredTransport": "JSONRPC",
  "version": "1.0.0",
  "provider": {
    "organization": "Acme Corp",
    "url": "https://agent.example.com"
  },
  "documentationUrl": "https://docs.example.com/agents",
  "capabilities": {
    "streaming": true,
    "pushNotifications": false,
    "stateTransitionHistory": true
  },
  "defaultInputModes": [
    "text/plain",
    "application/json"
  ],
  "defaultOutputModes": [
    "application/json",
    "text/plain"
  ],
  "skills": [
    {
      "id": "market-snapshot",
      "name": "Paid Market Snapshot ($0.02 x402)",
      "description": "Returns live pricing quote upon HTTP 402 PAYMENT-SIGNATURE verification.",
      "tags": [
        "x402",
        "payments",
        "finance"
      ],
      "examples": [
        "Run Paid Market Snapshot ($0.02 x402) for the current workspace"
      ]
    }
  ]
}
curl Verification Command
curl -fsSL -D - "https://agent.example.com/.well-known/agent-card.json" | head -n 40
Live Well-Known Audit 98.4% Lack Agent Cards

Verify live A2A, MCP, OAuth & AEO discovery in production

In RungLab's N=140 B2B SaaS Readiness Benchmark, 98.4% (62/63) of full-telemetry domains lacked agent-card.json. Audit your live domain with ReadyCheck, cut MCP schema token tax with MCPDiet, or automate fleet discovery checks via Apify & RapidAPI.

Required Endpoints, Paths & MIME Types

Path / Endpoint Purpose Required Content-Type
/.well-known/agent-card.json Publishes paid skills[], pricing descriptions, and x402 capability extension metadata application/json; charset=utf-8
HTTP 402 Endpoint Response Machine-readable PAYMENT-REQUIRED header / JSON challenge returned on paid invocation application/json

A2A Agent Card Advertising an x402-Enabled Paid Skill

agent-card-x402.json
{
  "protocolVersion": "0.3.0",
  "name": "Paid Research Agent (x402)",
  "description": "Pay-per-call market telemetry agent settling micropayments over HTTP 402 x402.",
  "url": "https://pay.example.com/a2a",
  "preferredTransport": "JSONRPC",
  "version": "1.0.0",
  "capabilities": {
    "streaming": false,
    "pushNotifications": false,
    "stateTransitionHistory": true,
    "extensions": [
      {
        "uri": "https://github.com/google-agentic-commerce/a2a-x402/v0.1",
        "description": "Supports HTTP 402 / x402 per-request cryptographic micropayments.",
        "required": true
      }
    ]
  },
  "defaultInputModes": ["application/json"],
  "defaultOutputModes": ["application/json"],
  "skills": [
    {
      "id": "market-snapshot",
      "name": "Paid Market Snapshot ($0.02 USDC)",
      "description": "Returns bounded quote metrics after HTTP 402 x402 payment verification.",
      "tags": ["x402", "payments", "finance"],
      "examples": ["Fetch NVDA 24h volatility snapshot"]
    }
  ]
}

HTTP 402 Payment Required Machine-Readable Response Contract

http-402-x402.http
HTTP/1.1 402 Payment Required
Content-Type: application/json
Cache-Control: no-store
PAYMENT-REQUIRED: eyJ4NDAyVmVyc2lvbiI6MiwiYWNjZXB0cyI6W3sic2NoZW1lIjoiZXhhY3QiLCJuZXR3b3JrIjoiZWlwMTU1Ojg0NTMiLCJtYXhBbW91bnRSZXF1aXJlZCI6IjIwMDAwIiwiYXNzZXQiOiIweDgzM1ZDRDk3Q2Q2RWJiNkU5OEVCRkI3QjY0MDYwMGE4N2Y2MzkxMDAifV19

{
  "x402Version": 2,
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "maxAmountRequired": "20000",
      "resource": "https://pay.example.com/a2a",
      "description": "Single market snapshot call ($0.02 USDC)",
      "mimeType": "application/json",
      "payTo": "0x000000000000000000000000000000000000dEaD",
      "maxTimeoutSeconds": 60,
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
    }
  ]
}

Key Empirical & Architectural Takeaways

  • HTTP 402 is already appearing in the wild: RungLab's 100-server MCP Registry audit observed a live endpoint returning HTTP 402 during automated protocol probing.
  • Advertising x402 support inside A2A capabilities.extensions[] and skill metadata lets autonomous buyer agents inspect unit pricing and supported settlement networks before invoking a paid endpoint.
  • Always pair paid discovery manifests with strict TLS (https://), bounded maxTimeoutSeconds, and zero leaked facilitator API keys or private keys in public JSON.

Common Production Pitfalls to Avoid

  • Returning a human-only HTML checkout page on HTTP 402 instead of machine-readable x402 JSON / PAYMENT-REQUIRED headers breaks programmatic agent wallets.
  • Embedding facilitator secret keys or signer private keys inside public /.well-known/agent-card.json.
  • Omitting asset contract addresses or CAIP-2 network IDs (e.g. eip155:8453) causes autonomous payment signers to reject the quote.

More Agent Discovery Specifications & Framework Guides

← Back to AI Agent Discovery Generator & Validator Hub

Frequently Asked Questions

How do autonomous agents know an endpoint supports x402 before calling it?

Publish an A2A /.well-known/agent-card.json declaring the x402 extension URI under capabilities.extensions[] alongside skill pricing tags, and return standard HTTP 402 PAYMENT-REQUIRED metadata if a request arrives without PAYMENT-SIGNATURE.

Can x402 and OAuth 2.0 (RFC 9728) be used together?

Yes. Enterprise agents often combine OAuth 2.0 identity (to attribute spend to an organization or rate-limit quota) with HTTP 402 / x402 per-call settlement.

What should never appear inside a public x402-enabled agent-card.json?

Never include facilitator secret keys, webhook signing secrets, or wallet private keys — only public receiving addresses, pricing schemas, and HTTPS endpoints belong in /.well-known/*.