[Agents] Expand x402 documentation into dedicated section#28398
[Agents] Expand x402 documentation into dedicated section#28398CameronWhiteside wants to merge 9 commits intocloudflare:productionfrom
Conversation
- Split single x402.mdx page into dedicated /agents/x402/ section - Add pages for charging (HTTP content, MCP tools) and paying (Agents SDK, coding tools) - Remove marketing language and question-based framing - Tighten content, remove redundant examples and ASCII diagrams - Link to GitHub templates for detailed configuration
|
/bonk review this PR. lean on the diataxis framework |
There was a problem hiding this comment.
Good restructure overall — splitting the single page into focused how-to guides with clear charge/pay separation is a solid improvement. The content is well organized and follows the style guide conventions.
I found a few code example issues and one documentation clarity point. See inline comments.
|
|
||
| Define protected routes in `wrangler.jsonc`: | ||
|
|
||
| ```json |
There was a problem hiding this comment.
Minor: the text says "Define protected routes in wrangler.jsonc" but the code block language is ```json. Since JSONC supports comments and the file extension is .jsonc, consider using ```jsonc for accuracy — though note jsonc may not be in the supported languages list for syntax highlighting (check if it falls back to txt). Alternatively, the <WranglerConfig> component could be used here for consistency with other docs, but since this is a template-specific vars fragment rather than a full Wrangler config, the raw block is fine.
There was a problem hiding this comment.
goign json here on the body type - but actually simplified this significantly
Co-authored-by: threepointone <threepointone@users.noreply.github.com>
|
The review has been submitted. Here's a summary of what I found: Review SummaryOverall: Good restructure. The split from a single page into focused how-to guides with clear "charge" vs "pay" separation is well-organized and follows the docs style guide. Issues found (7 inline comments):
|
|
Hmm I don't know why it isn't running the workflows, probably because this is happening off a fork. We need those workflows to run to see how it looks |
|
|
||
| The x402-proxy template is a Cloudflare Worker that sits in front of any HTTP backend. When a request hits a protected route, the proxy returns a 402 response with payment instructions. After the client pays, the proxy verifies the payment and forwards the request to your origin. | ||
|
|
||
| [](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/templates/tree/main/x402-proxy-template) |
There was a problem hiding this comment.
What are we deploying here? Can we add in a sentence to explicitly describe?
|
please don't land this just yet until we chat! |
- Fix code bugs: async onStart, this.env access, placeholder addresses - Restore sidebar order to 8 (was incorrectly changed to 5) - Add deploy button description - Simplify pay-with-tool-plugins: remove build step, reorder sections - Streamline intro text throughout
Summary
Expands the x402 documentation from a single overview page into a dedicated section with focused how-to guides for each integration pattern.
x402 is an open payment standard built on HTTP 402 that enables programmatic payments without accounts or API keys. This restructure helps developers find the right guide faster:
paidToolwithX402Clientfor automatic or human-approved paymentsThe previous single-page format mixed charging and paying use cases with marketing-style framing. The new structure uses direct technical language and links to GitHub templates for configuration details rather than duplicating content.
Documentation checklist
/agents/x402/path now serves the index page, so existing links continue to work.)