Skip to content

Add x402 monetization - let AI agents pay per API call#562

Closed
sam00101011 wants to merge 1 commit intoapify:masterfrom
sam00101011:add-x402-monetization
Closed

Add x402 monetization - let AI agents pay per API call#562
sam00101011 wants to merge 1 commit intoapify:masterfrom
sam00101011:add-x402-monetization

Conversation

@sam00101011
Copy link

@sam00101011 sam00101011 commented Mar 15, 2026

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 apify/apify-mcp-server's API endpoints. We found 4 endpoints in your README that agents could pay to access.

Why agents would pay for apify/apify-mcp-server

Each of these capabilities becomes a pay-per-call endpoint that AI agents discover and pay for automatically:

  • Access 8,000+ ready-made web scrapers and automation tools for AI agents — agents pay per call instead of needing credentials or rate-limited free tiers
  • Extract structured data from social media, e-commerce, and search engines — agents pay per call instead of needing credentials or rate-limited free tiers
  • Enable autonomous web research and RAG-ready content retrieval — agents pay per call instead of needing credentials or rate-limited free tiers
  • Facilitate agentic payments for actor runs without manual API tokens — agents pay per call instead of needing credentials or rate-limited free tiers
  • Automate complex workflows with schema-inferred structured output — agents pay per call instead of needing credentials or rate-limited free tiers

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

File Purpose
.well-known/x402.json Declares your endpoints, pricing, and wallet address - agents and routing networks use this for discovery
x402-middleware-example.ts Drop-in middleware that returns 402 and verifies payments

How it works

Agent -> calls your API
     <- 402 Payment Required (price: $0.01, wallet, network)
Agent -> signs USDC payment on Base
     -> retries with x-payment header
     <- normal API response

Settlement is instant. No intermediary holds funds. Revenue goes directly to your wallet.

What you'd earn

~$600/mo projected (4 endpoints x ~150 agent calls/mo x $0.01)

To activate

  1. Replace YOUR_WALLET_ADDRESS in .well-known/x402.json with your Base wallet
  2. Add the middleware to your server (see x402-middleware-example.ts)
  3. Deploy - your API is now discoverable by every agent on the 402.bot routing network

Your endpoints will automatically appear in Claude, Cursor, and any MCP-compatible agent via the 402.bot MCP server.

Live demo

See how apify/apify-mcp-server 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.

@jirispilka
Copy link
Collaborator

We're planning to add x402 at the Apify platform level, not just MCP.
The idea is that users pay for Actor runs (web automation, data extraction) - not for MCP tool calls themselves.

@MQ37 Please check this but I'm afraid we will close this PR

@MQ37
Copy link
Contributor

MQ37 commented Mar 22, 2026

@sam00101011 I am afraid I don't really get the purpose of this PR - it just add some dummy endpoint. We will be implementing the x402 protocol soon, so stay tuned.

closing this PR as we won't be using this and does not add any actual functionality.

@MQ37 MQ37 closed this Mar 22, 2026
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.

4 participants