Skip to content

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

Open
sam00101011 wants to merge 1 commit intokychee-com:mainfrom
sam00101011:add-x402-monetization
Open

Add x402 monetization - let AI agents pay per API call#2
sam00101011 wants to merge 1 commit intokychee-com:mainfrom
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 kychee-com/run402's API endpoints. We found 10 endpoints in your README that agents could pay to access.

Why agents would pay for kychee-com/run402

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

  • Automated Postgres database provisioning with integrated x402 payments — agents pay per call instead of needing credentials or rate-limited free tiers
  • Full-stack deployment of serverless functions and static sites — agents pay per call instead of needing credentials or rate-limited free tiers
  • AI-driven database management including SQL execution and RLS configuration — agents pay per call instead of needing credentials or rate-limited free tiers
  • On-demand image generation via text prompts with micropayment support — agents pay per call instead of needing credentials or rate-limited free tiers
  • Project lifecycle management including forking, versioning, and usage tracking — 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

~$1500/mo projected (10 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 kychee-com/run402 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.

@sam00101011 sam00101011 changed the title Add x402 monetization — let AI agents pay per API call Add x402 monetization - let AI agents pay per API call Mar 15, 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.

1 participant