Add one function call. Set your price. AI agents pay per request in USDC — instantly, on-chain, to your wallet. Free and open source.
Pick your framework. Your existing routes don't change.
// npm install @monapi/sdk @x402/express import express from "express"; import { monapi } from "@monapi/sdk"; const app = express(); // Global: every route costs $0.01 app.use(monapi({ wallet: process.env.WALLET, price: 0.01, })); // Or per-route pricing: app.use(monapi({ wallet: process.env.WALLET, routes: { "/api/weather": 0.01, "/api/forecast": 0.05, "/api/search": 0.10, }, }));
// npm install @monapi/sdk @x402/next import { withMonapi } from "@monapi/sdk/next"; import { NextResponse } from "next/server"; async function handler(request: Request) { return NextResponse.json({ temp: 22, city: "Berlin", }); } // Wrap your handler. Agents pay $0.01. export const GET = withMonapi(handler, { wallet: process.env.WALLET, price: 0.01, });
// npm install @monapi/sdk @x402/mcp import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { monapiMcp } from "@monapi/sdk/mcp"; import { z } from "zod"; const server = new McpServer({ name: "my-server", version: "1.0.0", }); // Create payment wrapper const paid = monapiMcp({ wallet: process.env.WALLET, price: 0.05, }); // Wrap any tool handler server.tool("search", { query: z.string() }, paid(async (args) => ({ content: [{ type: "text", text: "Results..." }], })) );
Agents can't fill forms, enter credit cards, or manage subscriptions. They hit your paywall and leave.
Via MCP, search, or documentation.
Account creation, email, API key, card on file.
Can't fill forms or enter payment details.
Finds an alternative or abandons the task.
A customer you never knew existed.
Via MCP, search, or documentation.
With the price you set, your wallet address, and token info.
$0.01 or $5 — you decide. On-chain, verified in under 2 seconds.
Your API responds normally. Agent continues its work.
USDC in your wallet. No invoice, no delay.
x402 is an open payment standard by Coinbase that embeds payments directly into HTTP requests.
No SDKs on the client side. No API keys. No accounts. The payment information is embedded in standard HTTP headers. Any x402-compatible agent can pay automatically.
Supported by Coinbase AgentKit, Cloudflare, Vercel, and the growing x402 ecosystem.
Learn more about x402Agent sends a normal HTTP request to your API
Server responds with HTTP 402 and payment terms
Agent signs a USDC payment and retries the request
Facilitator verifies, settles on-chain, API responds with HTTP 200
USDC on Base, Arbitrum, or Polygon. Gas fees are sponsored — agents only need USDC.
Express, Next.js, and MCP. One SDK, three entry points.
10,000 requests at $0.01 each. You set the price, you keep 100%.
USDC flows directly from the agent's wallet to yours via the x402 facilitator. monapi never holds, controls, or has access to your funds. No middleman. No delays. Gas fees are sponsored — agents only need USDC to pay.
Intercepts requests. Returns 402 with machine-readable terms. Verifies on-chain payment. Passes the request through.
Set different prices per endpoint. $0.01 for a weather lookup, $0.10 for a search. Configure it all in one object.
Wrap any MCP tool handler. AI agents discover, pay per invocation, get results. No API keys needed.
Base, Arbitrum, and Polygon. All with sub-cent transaction fees. Testnet support for development.
Agents only need USDC, no ETH or MATIC. Gas fees are sponsored by the x402 facilitator via EIP-3009. One less barrier to adoption.
Run npx monapi init to auto-detect your framework, configure your wallet, and generate starter code.
If AI agents would pay for your data, monapi gets you there in minutes.
Weather, finance, search, geolocation. Agents need one-off lookups and can't subscribe. Charge per request instead.
You built a useful tool but giving it away is unsustainable. Charge per invocation with a single wrapper function.
Inference, embeddings, fine-tuned models. Agents pay per call instead of negotiating contracts.
Install the SDK, add one line, start earning from AI agent traffic.
$ npm install @monapi/sdk
Free and open source. MIT licensed. Non-custodial. No monapi account needed.
No. Install the npm package, add one middleware call, and provide a wallet address. monapi handles all protocol logic, payment verification, and settlement.
Create a free Coinbase wallet, or use MetaMask, Rainbow, or any EVM-compatible wallet. You just need a public address that can receive USDC.
Agents using Coinbase AgentKit, Cloudflare Workers AI, Vercel, and other x402-compatible clients. The ecosystem is growing fast. Agents without x402 support simply receive a 402 response they can't act on.
Yes. Use the routes config object to set a price per path. $0.01 for a weather lookup, $0.10 for a search. Keep some routes free while gating others.
Base, Arbitrum, and Polygon. All with sub-cent transaction fees. Each chain has testnet support (Base Sepolia, Arbitrum Sepolia, Polygon Amoy).
Nothing changes for them. monapi only activates for requests that don't carry a valid session or API key. Your authenticated human users are completely unaffected.
1 USDC = $1 always. Convert to USD or EUR through Coinbase, Kraken, or any major exchange. Many developers keep USDC as-is.
The SDK is free and open source (MIT). There are no monapi fees. The only cost is the blockchain gas fee (typically <$0.01 on Base, Arbitrum, and Polygon).