
Monetize Service
Stand up an Express API that charges USDC per request via x402 so other agents can discover and pay on Base without accounts or API keys.
Overview
Monetize Service is an agent skill most often used in Build (also Launch, Grow) that deploys an x402 USDC pay-per-request Express API discoverable by other agents on Base.
Install
npx skills add https://github.com/coinbase/agentic-wallet-skills --skill monetize-serviceWhat is this skill?
- HTTP 402 flow: payment requirements, client-signed USDC retry, facilitator settle
- Express server template with per-endpoint USDC pricing on Base
- awal CLI checks (status, address, x402 details, x402 pay) at version 2.10.0
- Automatic discoverability for paying agents via x402 Bazaar registration
- No subscriptions or API keys for callers—pay-per-request USDC model
- Pinned awal CLI reference at version 2.10.0 in allowed-tool scopes
Adoption & trust: 2.9k installs on skills.sh; 110 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have a useful API but no lightweight way for other agents to pay per call without accounts, keys, or a full billing stack.
Who is it for?
Builders shipping agent-callable utilities who want micropayments in USDC and protocol-native discovery instead of manual invoicing.
Skip if: Human-only SaaS with seat-based Stripe billing and no machine clients—use traditional payment integration instead.
When should I use this skill?
User wants to monetize an API, earn money from endpoints, charge agents per request, or set up x402 paid service discovery.
What do I get? / Deliverables
You run an Express service with x402-protected routes, awal wallet settlement on Base, and Bazaar discoverability so agents pay USDC per request.
- Express x402 payment server
- Protected routes with USDC pricing metadata
- Bazaar-ready paid service configuration
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Paid agent-facing APIs are built and wired in Integrations, then discovered and scaled through Launch and Grow distribution. integrations covers HTTP payment middleware, wallet auth, and protocol wiring (x402, facilitator, Bazaar registration).
Where it fits
Wrap an internal enrichment API with x402 middleware and awal settlement before sharing a staging URL.
Register the service with the x402 Bazaar so autonomous clients can find and pay for your endpoint.
Add a second priced route and tune per-request USDC after watching agent call patterns.
How it compares
x402 micropayment server skill—not a marketplace MCP server or generic Stripe subscription boilerplate.
Common Questions / FAQ
Who is monetize-service for?
Solo developers and agent builders on Coinbase’s awal toolchain who want to charge other agents in USDC for HTTP endpoints on Base.
When should I use monetize-service?
In Build when adding paid routes to an API; in Launch when publishing a discoverable agent service to the x402 Bazaar; in Grow when turning an internal tool into a per-request revenue endpoint.
Is monetize-service safe to install?
It instructs Bash, npm, curl, and wallet operations that move real funds—review the Security Audits panel on this Prism page, pin awal versions, and never expose mainnet keys in logs.
SKILL.md
READMESKILL.md - Monetize Service
# Build an x402 Payment Server Create an Express server that charges USDC for API access using the x402 payment protocol. Callers pay per-request in USDC on Base — no accounts, API keys, or subscriptions needed. Your service is automatically discoverable by other agents via the x402 Bazaar. ## How It Works x402 is an HTTP-native payment protocol. When a client hits a protected endpoint without paying, the server returns HTTP 402 with payment requirements. The client signs a USDC payment and retries with a payment header. The facilitator verifies and settles the payment, and the server returns the response. Services register with the x402 Bazaar so other agents can discover and pay for them automatically. ## Confirm wallet is initialized and authed ```bash npx awal@2.10.0 status ``` If the wallet is not authenticated, refer to the `authenticate-wallet` skill. ## Step 1: Get the Payment Address Run this to get the wallet address that will receive payments: ```bash npx awal@2.10.0 address ``` Use this address as the `payTo` value. ## Step 2: Set Up the Project ```bash mkdir x402-server && cd x402-server npm init -y npm install express @x402/express @x402/core @x402/evm @x402/extensions ``` Create `index.js`: ```js const express = require("express"); const { paymentMiddleware } = require("@x402/express"); const { x402ResourceServer, HTTPFacilitatorClient } = require("@x402/core/server"); const { ExactEvmScheme } = require("@x402/evm/exact/server"); const app = express(); app.use(express.json()); const PAY_TO = "<address from step 1>"; // Create facilitator client and x402 resource server const facilitator = new HTTPFacilitatorClient({ url: "https://x402.org/facilitator" }); const server = new x402ResourceServer(facilitator); server.register("eip155:8453", new ExactEvmScheme()); // x402 payment middleware — protects routes below app.use( paymentMiddleware( { "GET /api/example": { accepts: { scheme: "exact", price: "$0.01", network: "eip155:8453", payTo: PAY_TO, }, description: "Description of what this endpoint returns", mimeType: "application/json", }, }, server, ), ); // Protected endpoint app.get("/api/example", (req, res) => { res.json({ data: "This costs $0.01 per request" }); }); app.listen(3000, () => console.log("Server running on port 3000")); ``` ## Step 3: Run It ```bash node index.js ``` Test with curl — you should get a 402 response with payment requirements: ```bash curl -i http://localhost:3000/api/example ``` ## API Reference ### paymentMiddleware(routes, server) Creates Express middleware that enforces x402 payments. | Parameter | Type | Description | | --------- | -------------------- | ---------------------------------------------------- | | `routes` | object | Route config mapping route patterns to payment config | | `server` | x402ResourceServer | Pre-configured x402 resource server instance | ### x402ResourceServer Created with a facilitator client. Register payment schemes and extensions before passing to middleware. ```js const { x402ResourceServer, HTTPFacilitatorClient } = require("@x402/core/server"); const { Exac