You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bb4ee80
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/content/docs/agents/agentic-payments/index.mdx
+10-29Lines changed: 10 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,14 @@ sidebar:
5
5
order: 8
6
6
group:
7
7
hideIndex: false
8
-
description: Let AI agents pay for services programmatically using open payment protocols like MPP and x402 with Cloudflare's Agents SDK.
8
+
description: Let AI agents pay for services programmatically using payment protocols like MPP and x402 with Cloudflare's Agents SDK.
9
9
---
10
10
11
11
import { LinkCard, CardGrid } from"~/components";
12
12
13
13
AI agents need to discover, pay for, and consume resources and services programmatically. The old way of onboarding required account creation, adding a payment method, and acquiring an API key before a payment can be made for services. Agentic payments as a category allows AI agents to purchase resources and services by interfacing with the HTTP 402: Payment Required response code.
14
14
15
-
Cloudflare's [Agents SDK](/agents/) supports agentic payments through two open protocols built on the HTTP `402 Payment Required` status code: **x402** and **Machine Payments Protocol (MPP)**. Both follow the same core flow:
15
+
Cloudflare's [Agents SDK](/agents/) supports agentic payments through two protocols built on the HTTP `402 Payment Required` status code: **x402** and **Machine Payments Protocol (MPP)**. Both follow the same core flow:
16
16
17
17
1. A client requests a resource or calls a tool.
18
18
2. The server responds with `402` and a payment challenge describing what to pay, how much, and where.
@@ -21,54 +21,35 @@ Cloudflare's [Agents SDK](/agents/) supports agentic payments through two open p
21
21
22
22
No accounts, sessions, or pre-shared API keys are required. Agents handle the entire exchange programmatically.
23
23
24
-
## x402 and MPP
24
+
## x402 and Machine Payments Protocol
25
25
26
26
### x402
27
27
28
-
[x402](https://www.x402.org/) is an open payment standard created by Coinbase. It uses on-chain stablecoin payments (USDC on Base, Ethereum, Solana, and other networks) and defines three HTTP headers — `PAYMENT-REQUIRED`, `PAYMENT-SIGNATURE`, and `PAYMENT-RESPONSE` — to carry challenges, credentials, and receipts. Servers can offload verification and settlement to a **facilitator** service so they do not need direct blockchain connectivity. It is governed by Coinbase and Cloudflare, two of the founding members of the x402 Foundation.
28
+
[x402](https://www.x402.org/) is a payment standard created by Coinbase. It uses on-chain stablecoin payments (USDC on Base, Ethereum, Solana, and other networks) and defines three HTTP headers — `PAYMENT-REQUIRED`, `PAYMENT-SIGNATURE`, and `PAYMENT-RESPONSE` — to carry challenges, credentials, and receipts. Servers can offload verification and settlement to a **facilitator** service so they do not need direct blockchain connectivity. It is governed by Coinbase and Cloudflare, two of the founding members of the x402 Foundation.
29
29
30
30
The Agents SDK provides first-class x402 integration:
31
31
32
32
-**Server-side**: `withX402` and `paidTool` for MCP servers, plus `x402-hono` middleware for HTTP Workers.
33
33
-**Client-side**: `withX402Client` wraps MCP client connections with automatic 402 handling and optional human-in-the-loop confirmation.
34
34
35
-
### MPP
35
+
### Machine Payments Protocol
36
36
37
-
[MPP (Machine Payments Protocol)](https://mpp.dev) is an open protocol co-authored by Tempo Labs and Stripe. It extends the HTTP `402` pattern with a formal `WWW-Authenticate: Payment` / `Authorization: Payment` header scheme and is on the IETF standards track.
37
+
[Machine Payments Protocol (MPP)](https://mpp.dev) is a protocol co-authored by Tempo Labs and Stripe. It extends the HTTP `402` pattern with a formal `WWW-Authenticate: Payment` / `Authorization: Payment` header scheme and is on the IETF standards track.
38
38
39
39
MPP supports multiple payment methods beyond blockchain — including cards (via Stripe), Bitcoin Lightning, and stablecoins — and introduces **sessions** for streaming and pay-as-you-go use cases with sub-millisecond latency and sub-cent costs. MPP is backwards-compatible with x402: MPP clients can consume existing x402 services without modification.
40
40
41
41
## Charge for resources
42
42
43
-
Use these guides to gate your own services behind payments:
44
-
45
43
<CardGrid>
46
44
<LinkCard
47
-
title="HTTP content"
45
+
title="HTTP content (x402)"
48
46
description="Gate APIs, web pages, and files with a Worker proxy"
Copy file name to clipboardExpand all lines: src/content/docs/agents/agentic-payments/mpp/index.mdx
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ description: Accept and make payments using the Machine Payments Protocol (MPP)
10
10
11
11
import { LinkCard, CardGrid } from"~/components";
12
12
13
-
[MPP (Machine Payments Protocol)](https://mpp.dev) is an open protocol for machine-to-machine payments, co-authored by [Tempo Labs](https://tempo.xyz) and [Stripe](https://stripe.com). It standardizes the HTTP `402 Payment Required` status code with a formal authentication scheme proposed to the [IETF](https://paymentauth.org), giving agents, apps, and humans a single interface to pay for any service in the same HTTP request.
13
+
[Machine Payments Protocol (MPP)](https://mpp.dev) is a protocol for machine-to-machine payments, co-authored by [Tempo Labs](https://tempo.xyz) and [Stripe](https://stripe.com). It standardizes the HTTP `402 Payment Required` status code with a formal authentication scheme proposed to the [IETF](https://paymentauth.org), giving agents, apps, and humans a single interface to pay for any service in the same HTTP request.
14
14
15
15
MPP is payment-method agnostic. A single endpoint can accept stablecoins (Tempo), credit cards (Stripe), or Bitcoin (Lightning).
16
16
@@ -73,5 +73,4 @@ The TypeScript SDK includes framework middleware for [Hono](https://mpp.dev/sdk/
73
73
74
74
-[mpp.dev](https://mpp.dev) — Protocol documentation and quickstart guides
75
75
-[IETF specification](https://paymentauth.org) — Full Payment HTTP Authentication Scheme specification
76
-
-[x402](/agents/agentic-payments/x402/) — Coinbase's open payment standard, compatible with MPP
77
76
-[Pay Per Crawl](/ai-crawl-control/features/pay-per-crawl/) — Cloudflare-native monetization for web content
Copy file name to clipboardExpand all lines: src/content/docs/agents/agentic-payments/x402/index.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ sidebar:
9
9
10
10
import { LinkCard, CardGrid } from"~/components";
11
11
12
-
[x402](https://www.x402.org/) is an open payment standard built around HTTP 402 (Payment Required). Services return a 402 response with payment instructions, and clients pay programmatically without accounts, sessions, or API keys.
12
+
[x402](https://www.x402.org/) is a payment standard built around HTTP 402 (Payment Required). Services return a 402 response with payment instructions, and clients pay programmatically without accounts, sessions, or API keys.
0 commit comments