Merit Systems

Introducing @agentcash/router

Introducing @agentcash/router

Merit Systems

July 15, 2026

Today we're open-sourcing @agentcash/router, the library we've used to build every paid endpoint at Merit Systems, and the fastest way we know to make an API discoverable and payable by agents.

Why we built it

You probably have a general understanding of x402 and MPP: one HTTP request, a 402 with a price, a signed payment, a retry, and the product you requested.

That's the easy part.

The hard part is the gap between standing up an endpoint and turning agents into paying customers. We've tested tens of thousands of resources registered on x402scan and mppscan, and the same few things separated the endpoints that earned from the ones that quietly failed:

  • Every agentic payment method. USDC via x402 and MPP, at fixed prices or metered per token, per request, per unit of work.
  • Discovery.`openapi.json` and `llms.txt` are how agents find, understand, and call your API. If they aren't structured right, agents can't use your endpoints out of the box and the marketplaces can't index them.
  • Identity without accounts. There are no accounts in agentic commerce, so a wallet signature is how you recognize a returning buyer, grant pay-once access, and keep per-user state across every instance of your server.
    Try to implement all of this by hand and you're probably looking at several days of work, at least.

What the router does

@agentcash/router packages our entire proxy architecture, and everything we learned building on top of it, into one standardized implementation that's correct by construction. A complete paid endpoint answers x402 and MPP challenges, validates its inputs, publishes its own discovery docs, and hands your customers wallet-based identities, all from the same route.

Since every router endpoint emits the same 402 shape, the same schemas, and the same settlement behavior, endpoints built on it work for any agent with a wallet.

The proof

This package is proven, and we just made it open source. We've relied on it to build each of the 44 origins at Merit Systems, which have generated ~$40K in revenue over ~765K transactions so far in 2026.

Take an API you've built, point your coding agent at it, and gave it one instruction:

> Read agentcash.dev/merchants.md and follow the guide to make my API discoverable and payable by agents. Only ask me questions if you need input you can't determine yourself.

The agent will install the router, convert every endpoint into a paid route, publish the discovery docs, and register everything to x402scan and mppscan. It's that easy.

Get started

Pick the path that fits where you are:

  • Want to see how fast this goes? The one-click Vercel template clones a working pay-per-call API into your GitHub, asks for three env vars, and puts you live with every pricing mode already wired up. Swap the demo routes for your real ones and you're live in five minutes.
  • Not on Vercel? Follow the walkthrough to build from scratch with Next.js, Hono, Bun, or Node.
  • Already on x402 or MPP? There's a short guide for moving onto the router.
  • Already have an API? Hand the prompt above to your coding agent and let it do the work.

Welcome to agentcash router and as always, reach out with any feedback.

More from Merit