Skip to content

docs: add a cookbook recipe for paying an x402 API#16285

Open
John-Weeks-Dev wants to merge 1 commit into
vercel:mainfrom
John-Weeks-Dev:add-x402-recipe
Open

docs: add a cookbook recipe for paying an x402 API#16285
John-Weeks-Dev wants to merge 1 commit into
vercel:mainfrom
John-Weeks-Dev:add-x402-recipe

Conversation

@John-Weeks-Dev

Copy link
Copy Markdown

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).

  • New file: content/cookbook/05-node/58-pay-x402-api.mdx
  • Uses the current AI SDK API (inputSchema, stopWhen: isStepCount, jsonSchema); mirrors 54-mcp-tools.mdx.
  • Docs-only — no changeset.

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant