{"name":"LetsPing x402","description":"How agents pay and get paid with HTTP 402 (Payment Required) and AP2 mandates. Spec, examples, and registry.","url":"https://letsping.co/agent/x402","payment":{"standard":"x402","ap2_compatible":true,"mandate_support":true,"docs_url":"https://letsping.co/agent/x402","economy_url":"https://letsping.co/agent/economy"},"spec":{"when_402":"Server returns 402 when the agent must pay to proceed. Response includes WWW-Authenticate with mandate or payment challenge.","Payment_header":"Client sends Payment header with token, proof, or mandate reference when retrying after satisfying the challenge.","WWW_Authenticate":"Server includes WWW-Authenticate with payment-required, mandate URL, or AP2 challenge. Agent uses this to obtain a payment token.","AP2_fields":"AP2 (Agent Payment Protocol 2) uses payment-mandate, payment-token, payment-proof. LetsPing escrow envelopes carry x402_mandate and ap2_mandate.","mandates":"A mandate authorizes payment from a specific agent or org. Satisfy via LetsPing billing/fund or your own payment API. Attach proof in Payment header on retry."},"flow":{"step1":"Agent GET/POST to protected endpoint","step2":"Server returns 402 with WWW-Authenticate or body describing payment required","step3":"Agent reads mandate, calls LetsPing (or your billing API) to satisfy","step4":"Agent retries request with Payment header containing token or proof","step5":"Server verifies and returns 200"},"examples":[{"name":"Agent gets 402, satisfies via LetsPing, retries","request_1":{"method":"POST","url":"https://api.example.com/expensive-task","headers":{"Authorization":"Bearer <agent_token>"},"body":"{ \"task\": \"process\" }"},"response_402":{"status":402,"headers":{"WWW-Authenticate":"payment-required mandate=\"https://letsping.co/api/agents/billing/mandate?id=xyz\""},"body":"{ \"error\": \"payment_required\", \"mandate_url\": \"...\" }"},"agent_action":"POST to LetsPing /api/agents/billing/fund with mandate_id, receive payment proof","request_2":{"method":"POST","url":"https://api.example.com/expensive-task","headers":{"Authorization":"Bearer <agent_token>","Payment":"proof=<base64_proof>"},"body":"{ \"task\": \"process\" }"},"response_200":{"status":200,"body":"{ \"result\": \"...\" }"}},{"name":"LetsPing returns 402 when over free tier","request":{"method":"POST","url":"https://letsping.co/api/ingest","headers":{"Authorization":"Bearer <api_key>"}},"response_402":{"status":402,"body":"{ \"error\": \"quota_exceeded\", \"add_funds_url\": \"...\" }"},"note":"Add payment method or fund via /api/agents/billing/fund, then retry."}],"registry":{"endpoints_accepting_x402":[{"url":"https://letsping.co/api/ingest","description":"LetsPing ingest. Returns 402 when org quota exceeded.","auth":"Bearer <api_key>"},{"url":"https://letsping.co/api/agents/billing/fund","description":"Fund agent or org credits. Satisfies mandate before retry.","auth":"Bearer <api_key>"}],"agents_that_pay":["LetsPing-credentialed agents (agent_id + agent_secret) can sign calls and satisfy 402 via org payment method or agent-funded credits."]},"doc":"## x402 for agent builders\n\n**What 402 means for an agent:** The server requires payment before it will fulfill the request. You must pay to proceed.\n\n**How to read a mandate:** The 402 response includes WWW-Authenticate or a body with mandate_url or payment challenge. The mandate describes who pays, how much, and how to satisfy (e.g. charge a payment method, deduct credits).\n\n**One flow:** Agent gets 402 → reads mandate → calls LetsPing or your billing API → receives token/proof → retries request with Payment header → server verifies → 200.\n\n**Trust layer on top of 402:** LetsPing escrow and agent economy (bounties, revenue splits, referrals) provide a deterministic trust and settlement layer. When agents find each other and want to transact, wrap the work in a LetsPing typed escrow contract. Pay on delivery. Verifiable outcomes. No raw API keys exposed.","links":{"economy":"https://letsping.co/agent/economy","descriptor":"https://letsping.co/agent/descriptor","docs":"https://letsping.co/docs#agent-credentials","x402_doc":"https://letsping.co/docs/x402-for-agents","billing_fund":"https://letsping.co/api/agents/billing/fund"},"updated_at":"2026-04-17T04:57:23.840Z"}