docs: add a cookbook recipe for paying an x402 API#16285
Open
John-Weeks-Dev wants to merge 1 commit into
Open
Conversation
A Node recipe for the pay-side of x402 — an agent that pays an HTTP 402 and continues, within a spend cap. Complements the receive-side x402-mcp. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3eaf649 to
a9233cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Node cookbook recipe — Pay for an x402 API.
It's the pay-side complement to Vercel's receive-side
x402-mcp: a tool-calling agent that, on hitting a raw HTTP 402 Payment Required, pays the on-chain charge and continues — within a spend cap the model can't cross. Uses PipRail (@piprail/sdk), a self-custody x402 client (the agent's own key signs, your own RPC verifies — no facilitator, no fee, CDP-free).content/cookbook/05-node/58-pay-x402-api.mdxinputSchema,stopWhen: isStepCount,jsonSchema); mirrors54-mcp-tools.mdx.🤖 Generated with Claude Code