# Payrelayer > Payrelayer lets developers monetize APIs, MCP tools, and website content for AI agents using the x402 protocol (HTTP 402 Payment Required) with USDC settlement on Base. Add one SDK middleware (9 frameworks) or wrap an MCP tool with `paid()`; agents pay per request/tool-call. Standard x402 clients are supported, and routes can be listed in the x402 Bazaar for agent discovery. Key facts: per-request pricing set per route; test and live modes; managed USDC payouts; webhooks for payment/settlement/payout events; 5% platform fee. Payrelayer is standard-x402 compatible (accepts[] challenges + X-PAYMENT) and also ships an MCP tool-monetization wrapper. ## Docs - [Protocol reference](https://payrelayer.com/docs): the X402v1 wire contract, signing, and the challenge/verify HTTP flow. - [SDKs overview](https://payrelayer.com/sdks): 9 framework SDKs sharing one wire contract. - [Pricing](https://payrelayer.com/pricing): plans and the platform fee. - [For developers](https://payrelayer.com/for-developers) · [For site owners](https://payrelayer.com/for-site-owners) ## SDKs - [x402 Express SDK](https://payrelayer.com/sdks/express): Add pay-per-request to any Express route with a single middleware — no settlement code in your app. - [x402 Next.js SDK](https://payrelayer.com/sdks/next): Edge-safe x402 payment gate for Next.js App Router route handlers. - [x402 FastAPI SDK](https://payrelayer.com/sdks/fastapi): One async decorator turns a FastAPI endpoint into a pay-per-call route. - [x402 Laravel SDK](https://payrelayer.com/sdks/laravel): Charge agents per route in Laravel with one middleware alias. - [x402 Go SDK](https://payrelayer.com/sdks/go): stdlib-only net/http x402 middleware for Go — zero external dependencies. - [x402 Spring Boot SDK](https://payrelayer.com/sdks/spring): Add pay-per-request to any Spring Boot route with one filter. - [x402 ASP.NET Core SDK](https://payrelayer.com/sdks/aspnetcore): Charge agents per endpoint in ASP.NET Core with one middleware. - [x402 Rails SDK](https://payrelayer.com/sdks/rails): Monetise Rails routes with a single Rack middleware. - [x402 Django SDK](https://payrelayer.com/sdks/django): Pay-per-call for Django views with one middleware. ## Use cases - [Monetize your API for AI agents](https://payrelayer.com/use-cases/monetize-api-for-ai-agents): Charge AI agents per API call instead of provisioning keys and plans for callers you’ll never meet. Register a route, add one middleware, and any endpoint returns a signed x402 challenge — agents pay in USDC and the call succeeds. - [Charge AI crawlers for your content](https://payrelayer.com/use-cases/charge-ai-crawlers): Stop giving content to AI crawlers for free. Connect Cloudflare and a Worker decides allow, block, or charge at the edge — crawlers get a USDC price instead of free content, while human visitors pass through untouched. - [Monetize an MCP server](https://payrelayer.com/use-cases/monetize-mcp-server): Charge per tool call on your MCP server. Pair MCP with x402: each tool exposes a price, the agent’s runtime pays in USDC, and you settle per invocation — without building a billing system or handling wallets yourself. - [Charge for data & RAG endpoints](https://payrelayer.com/use-cases/paid-data-and-rag-endpoints): Put a price on each query to a data or retrieval endpoint. Agents calling your search, embeddings, or RAG API pay per request in USDC — so high-value data earns per use instead of being scraped for free. ## Comparisons - [Payrelayer vs Stripe agentic payments](https://payrelayer.com/vs/stripe): Stripe is mature card-rail infrastructure, now extending to agent-mediated commerce (e.g. its agentic / marketplace payment work). Payrelayer takes a different shape: an open x402 protocol where agents pay per call in USDC, with no card, no caller signup, and no chargebacks. - [Payrelayer vs API keys + metered billing](https://payrelayer.com/vs/api-keys): The traditional way to monetise an API is to issue API keys, meter usage, and invoice (often via a metered-billing provider). It works for known customers but assumes a human signs up first. Payrelayer lets agents pay per call with no key to provision. - [Payrelayer vs L402 (Lightning)](https://payrelayer.com/vs/l402): L402 is an open pay-per-request scheme built on Bitcoin Lightning and macaroon-based tokens — also a 402-driven flow. Payrelayer builds on x402 with USDC on Base, a dollar-denominated stablecoin unit and official SDKs across nine languages. - [Payrelayer vs TollBit](https://payrelayer.com/vs/tollbit): TollBit is a marketplace that helps publishers charge AI crawlers and agents for content, with strong analytics on which bots access what. It’s built around media/publisher licensing and fiat settlement. Payrelayer is a developer platform for pricing APIs, MCP tools, and content per request via the open x402 protocol, settled in USDC. - [Payrelayer vs Cloudflare Pay Per Crawl](https://payrelayer.com/vs/cloudflare-pay-per-crawl): Cloudflare Pay Per Crawl lets site owners charge AI crawlers at the edge, with Cloudflare as Merchant of Record settling in fiat via Stripe, and cryptographic bot identity via Web Bot Auth. It’s powerful but gated (closed beta / enterprise). Payrelayer is a self-serve developer platform pricing APIs, MCP tools, and content per request via open x402 in USDC. ## Glossary - [x402](https://payrelayer.com/glossary/x402): x402 is an open protocol for charging for an HTTP request with a stablecoin payment. The server answers an unpaid request with HTTP 402 and a signed challenge that quotes a price; the caller pays in USDC and retries, and the request succeeds. - [HTTP 402 Payment Required](https://payrelayer.com/glossary/http-402): HTTP 402 is a status code reserved for “Payment Required.” It went unused for decades; x402 gives it a concrete meaning — a 402 response carries a signed challenge with the price and how to pay, so the caller can pay and retry. - [402 challenge](https://payrelayer.com/glossary/402-challenge): A 402 challenge is the signed JSON a server returns with an HTTP 402 response. It states the price, the accepted payment details, and a one-time nonce, so the caller knows exactly what to pay and how to prove it on retry. - [Nonce](https://payrelayer.com/glossary/nonce): A nonce is a one-time value included in a 402 challenge. It binds a payment to a single request so the same proof can’t be replayed to unlock access twice. The caller echoes it back when retrying with payment. - [USDC](https://payrelayer.com/glossary/usdc): USDC is a US-dollar stablecoin. In x402, prices are quoted and paid in USDC, so a “$0.01 per call” price means one cent of USDC — predictable, dollar-denominated amounts that suit tiny per-request payments. - [Base](https://payrelayer.com/glossary/base): Base is a low-fee Ethereum Layer 2 network. x402 payments in Payrelayer are priced and paid in USDC on Base, which keeps per-call fees small enough for micropayments while remaining widely supported by wallets and agent runtimes. - [Micropayment](https://payrelayer.com/glossary/micropayment): A micropayment is a very small payment — often a fraction of a cent to a few cents. Pay-per-call API pricing is a micropayment use case: each request is charged individually rather than bundled into a monthly invoice. - [Pay-per-call](https://payrelayer.com/glossary/pay-per-call): Pay-per-call means charging for each individual API request instead of a subscription or quota. The caller pays the quoted price for a call and gets the result; there’s no plan to manage and no “calls left this month.” - [Agentic web](https://payrelayer.com/glossary/agentic-web): The agentic web is the emerging pattern where autonomous AI agents — not just people in browsers — read, call, and transact across the web on a user’s behalf. It creates demand for machine-native payments like x402. - [AI agent](https://payrelayer.com/glossary/ai-agent): An AI agent is a program that pursues a goal by taking actions — calling tools and APIs, reading results, and deciding what to do next — with little or no human steering. To use paid resources, an agent needs a way to pay programmatically. - [MCP (Model Context Protocol)](https://payrelayer.com/glossary/mcp): MCP is a protocol for exposing tools and data to AI models in a standard way. An MCP server offers tools an agent can call; pairing MCP with x402 lets an MCP server charge per tool call in USDC. - [Test mode (sandbox)](https://payrelayer.com/glossary/test-mode): Test mode runs the full x402 flow — challenge, pay, verify, allow — without spending real USDC. Sandbox keys simulate payments so you can build and CI-test an integration, then flip one environment variable to go live. - [Fail-closed](https://payrelayer.com/glossary/fail-closed): Fail-closed means that when something goes wrong — a payment can’t be verified or the platform is unreachable — access is denied rather than granted. Payrelayer’s SDKs return 502 instead of ever serving paid content for free. - [X402v1 wire contract](https://payrelayer.com/glossary/x402v1-wire-contract): The X402v1 wire contract is the frozen byte-level format of an x402 challenge and payment proof. “Frozen” means it doesn’t change, so every official SDK signs and verifies identically — behaviour can’t drift between languages. ## Blog - [The machine-to-machine economy: what changes when software pays software](https://payrelayer.com/blog/machine-to-machine-economy): For the first time, software doesn't just call software — it pays it. That turns agents that can act into agents that can transact. Here's the shift, the emerging stack, and what's real vs hype. - [How to add pay-per-call to an existing API without breaking your customers](https://payrelayer.com/blog/add-pay-per-call-to-existing-api): You have a real API business — keys, plans, paying customers. Here's how to add an x402 pay-per-call lane for AI agents without touching the customers who already pay you. - [Debugging x402: every error code and how to fix it](https://payrelayer.com/blog/debugging-x402-errors): A 402 gate fails with a precise reason, not a vague error. Here's every x402 status code and reason — invalid_signature, expired, unpaid, no_such_route, 502 — what each means, and the fix. - [Handling x402 payment webhooks: settlement, payouts, and reconciliation](https://payrelayer.com/blog/x402-payment-webhooks): Your route returns a 402 and the agent pays — but your app needs to know when money settled and when payouts land. Here's how to consume x402 webhooks correctly: signature verification, idempotency, and reconciliation. - [Your API's next customer is an AI agent: what actually changes](https://payrelayer.com/blog/api-customer-is-an-ai-agent): Agent-ready API guides tell you to ship OpenAPI and clean docs. That makes your API callable. This is about the part they skip — what changes in pricing, billing, and identity when the buyer is software. - [How to monetize a data or RAG API for AI agents](https://payrelayer.com/blog/monetize-data-rag-api-for-ai-agents): Your search, embeddings, and RAG endpoints are exactly what AI agents want to call — and exactly what gets scraped for free. Here's how to charge per query in USDC, without contracts. - [HTTP 402 vs 429: rate limiting vs paying to continue](https://payrelayer.com/blog/http-402-vs-429): 429 says slow down; 402 says pay up. Here's the real difference between HTTP 429 Too Many Requests and 402 Payment Required, when to return each, and how they combine for AI-agent traffic. - [How to test x402 payments: a sandbox-to-live workflow](https://payrelayer.com/blog/how-to-test-x402-payments): You shouldn't move real USDC to know your paywall works. Here's how to test x402 end to end — synthetic sandbox vs testnet, the failure modes that matter, and CI — before you flip to live. - [HTTP 402 Payment Required: the complete guide (2026)](https://payrelayer.com/blog/http-402-payment-required): What HTTP 402 Payment Required means, why it sat unused for ~30 years, and how x402 revived it so APIs and AI agents can settle payment per request. With code, comparison tables, and FAQ. - [Is x402 worth it yet? An honest look at the skeptics](https://payrelayer.com/blog/is-x402-worth-it): The loudest take on x402 is that demand isn't there, it's just crypto, and micropayments always fail. Some of that is fair. Here's an honest answer to each objection — including the one reason the old micropayment arguments don't apply when the buyer is software. - [Verify the agent before you charge it: Web Bot Auth, signed agents, and x402](https://payrelayer.com/blog/verify-ai-agents-web-bot-auth): A user-agent string is free text — 'GPTBot' can be anyone. Web Bot Auth gives you cryptographic proof of which agent is really calling. Here's how verified identity works, and how it pairs with charging agents per request. - [How to price (and meter) an MCP server](https://payrelayer.com/blog/how-to-price-an-mcp-server): You built a useful MCP server. The market average price is $0. Here's how to choose a pricing model that isn't zero — per-call, subscription, or both — and how to handle the metering problems that make charging the genuinely hard part. - [Pay Per Crawl vs TollBit vs x402: how to actually get paid by AI crawlers](https://payrelayer.com/blog/pay-per-crawl-vs-tollbit-vs-x402): Three real ways to charge AI crawlers in 2026 — Cloudflare's Pay Per Crawl, marketplaces like TollBit, and the open x402 protocol. Here's how each one works, who it fits, and the trade-offs nobody puts in the launch post. - [x402 vs AP2 vs ACP vs MPP: which agent-payment protocol do you actually need?](https://payrelayer.com/blog/x402-vs-ap2-vs-acp-vs-mpp): 2026 gave us an alphabet soup of agent-payment standards — x402, AP2, ACP, MPP, plus L402. They sound like competitors. They're mostly layers. Here's the map: what each one does, where they overlap, and how to pick without guessing. - [Don't block AI crawlers — charge them](https://payrelayer.com/blog/dont-block-ai-crawlers-charge-them): Blocking GPTBot and ClaudeBot is the default advice in 2026, and it's the option that leaves money on the table. Here's the third choice — charge crawlers per request at the edge — and when it beats both blocking and allowing. - [Pay-per-call vs subscriptions: pricing for AI-agent customers](https://payrelayer.com/blog/pay-per-call-vs-subscriptions-ai-agents): Subscriptions and quotas were built for humans who plan ahead. Autonomous agents decide call-by-call. Here's why per-call pricing fits agent buyers — and when a subscription still wins. - [5 ways to get paid by AI agents and crawlers in 2026](https://payrelayer.com/blog/ways-to-get-paid-by-ai-agents-2026): A practical map of the ways to charge AI agents and crawlers — edge paywalls, pay-per-call APIs, MCP tool calls, paid data endpoints — and how they compare to API keys and card rails. - [How to monetize your API for AI agents: a 2026 playbook](https://payrelayer.com/blog/monetize-api-for-ai-agents-playbook): A step-by-step playbook for charging AI agents per API call: decide what to meter, set a price, drop in one SDK, test it for free, and go live — without building a billing system. - [How AI agents pay for APIs: a primer on HTTP 402, x402, and the client side](https://payrelayer.com/blog/how-ai-agents-pay-apis): Most x402 writing is for API owners. This is for the other side — the developer building an agent that has to read a price, pay it, and continue. Here is what the wallet, the handshake, and the budget actually look like. - [x402 vs Stripe's MPP: choosing payment infrastructure for AI agents in 2026](https://payrelayer.com/blog/x402-vs-stripe-mpp): Stripe launched its Machine Payments Protocol in March 2026. x402 has been in production for longer. Here is how they actually differ — and which one fits which workload — without the marketing varnish. - [MCP server monetization with x402: charging AI agents per tool call](https://payrelayer.com/blog/mcp-server-monetization-x402): MCP standardised how AI agents call your tools — but it left the bill unpaid. Here is how x402 fills that gap with a pay-per-call price on each tool, no API keys, no plans. - [The agentic web's payments gap — and what a signed HTTP 402 actually solves](https://payrelayer.com/blog/agentic-web-payments-gap): Programs are becoming first-class clients on the web. The piece that has been missing is a payments primitive software can read, decide on, and act on. Here is what 'signed 402' adds — and why it matters. - [How to price an API for AI agents (without leaving money on the table)](https://payrelayer.com/blog/how-to-price-api-for-ai-agents): Pricing an API for autonomous AI callers is different from pricing for developers. Pick the right unit, anchor against three reference points, and use a test mode to iterate without burning real funds. - [x402 vs API keys: monetising APIs in the agent era](https://payrelayer.com/blog/x402-vs-api-keys): API keys plus monthly plans were built for human developers signing up. Autonomous AI agents want to pay per request and disappear. Here is how x402 differs — and where each still fits. - [x402 developer integration guide: add pay-per-call to your API in ~5 minutes](https://payrelayer.com/blog/x402-developer-integration-guide): The end-to-end path for developers: register a monetised route, grab a test key, add one middleware, go live. Pick the official SDK for your stack — nine of them, one frozen contract. - [How Payrelayer charges AI crawlers for site owners (the Cloudflare-edge path)](https://payrelayer.com/blog/charge-ai-crawlers-site-owners): Connect Cloudflare, write a pricing rule, and AI crawlers get quoted a price instead of taking your content for free — decided at the edge, before your origin, with humans untouched and no code changes. - [x402 technical deep dive: the X402v1 wire contract, signing, and the request flow](https://payrelayer.com/blog/x402-technical-deep-dive): How x402 works under the hood: the frozen X402v1 canonical string, HMAC-SHA256 request signing, the challenge/verify flow, fail-closed semantics, and byte-identical SDK conformance. - [What is x402? Getting paid when software uses your site or API](https://payrelayer.com/blog/what-is-x402): Plain-English explainer: x402 lets websites and APIs charge automated visitors (AI agents and crawlers) a small amount per request — no invoices, no crypto knowledge needed. ## Optional - [Full text for LLMs](https://payrelayer.com/llms-full.txt): all public content concatenated. - [OpenAPI spec](https://payrelayer.com/openapi.yaml): the public API.