Add x402 monetization - let AI agents pay per API call#43
Open
sam00101011 wants to merge 1 commit into21st-dev:mainfrom
Open
Add x402 monetization - let AI agents pay per API call#43sam00101011 wants to merge 1 commit into21st-dev:mainfrom
sam00101011 wants to merge 1 commit into21st-dev:mainfrom
Conversation
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.
What is this?
x402 is an open protocol that lets AI agents pay for API calls using the HTTP 402 status code. Instead of API keys and billing dashboards, agents pay per call in USDC on Base.
This PR adds the foundation for monetizing 21st-dev/magic-mcp's API endpoints. We found 1 endpoint in your README that agents could pay to access.
Why agents would pay for 21st-dev/magic-mcp
Each of these capabilities becomes a pay-per-call endpoint that AI agents discover and pay for automatically:
With x402, every feature above is instantly monetizable. Agents on Claude, Cursor, and any MCP client can discover and pay for access via 402.bot.
What's included
.well-known/x402.jsonx402-middleware-example.ts402 Payment Requiredand verifies paymentsHow it works
Settlement is instant. No intermediary holds funds. Revenue goes directly to your wallet.
What you'd earn
~$150/mo projected (1 endpoint × ~150 agent calls/mo × $0.01)
To activate
YOUR_WALLET_ADDRESSin.well-known/x402.jsonwith your Base walletx402-middleware-example.ts)Your endpoints will automatically appear in Claude, Cursor, and any MCP-compatible agent via the 402.bot MCP server.
Live demo
See how 21st-dev/magic-mcp works on the x402 network ->
Links
This PR was opened by 402.bot. x402 is an open protocol - you keep 100% of revenue. We just route agents to providers. If this isn't relevant, feel free to close.