Help us improve
Share bugs, ideas, or general feedback.
From stripe-mpp
Implements MPP payment proxies with mppx: wraps APIs in HTTP 402 gates for pay-per-use without upstream changes. For monetizing APIs or marketplaces.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin stripe-mppHow this skill is triggered — by the user, by Claude, or both
Slash command
/stripe-mpp:mpp-proxyThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Fetch live docs**:
Implements Mppx server middleware for Hono, Express, Next.js, and Elysia to protect API routes with HTTP 402 payment gates, verify proofs of payment, and configure methods like Stripe.
Injects x402 payment middleware into Express APIs to enforce USDC micropayments on Base L2 for machine-to-machine monetization. Useful for premium endpoints or MCP servers.
Builds an Express server that charges USDC per API request using the x402 payment protocol. Use for monetizing endpoints as a paid service discoverable by other agents.
Share bugs, ideas, or general feedback.
Fetch live docs:
https://www.npmjs.com/package/mppx for the proxy handler API and configurationmppx proxy payment 402 existing API monetize for proxy implementation patternssite:github.com stripe-samples machine-payments proxy for official proxy sample codehttps://developers.cloudflare.com/agents/agentic-payments/mpp/ for Cloudflare Workers proxy patternsThe MPP proxy wraps an existing upstream API with a payment gate, requiring clients to pay before their requests are forwarded. The upstream API is unmodified — it never sees the payment flow.
Client → MPP Proxy (402 challenge-response) → Upstream API
↑ payment gate ↑ unmodified
┌──────────────┐ ┌──────────────────────┐ ┌──────────────┐
│ AI Agent │────→│ MPP Proxy │────→│ Upstream │
│ (Client) │←────│ 1. 402 Challenge │←────│ API │
│ │ │ 2. Verify Payment │ │ (Unmodified)│
│ │ │ 3. Forward Request │ │ │
│ │ │ 4. Return + Receipt │ │ │
└──────────────┘ └──────────────────────┘ └──────────────┘
The mppx SDK provides a dedicated proxy handler:
import { Mppx, tempo } from 'mppx/server';
const mppx = Mppx.create({
secretKey: process.env.MPP_SECRET_KEY,
methods: [tempo.charge({ /* config */ })],
});
// Proxy all requests to upstream with payment gate
app.all('/api/*', mppx.charge({ amount: '100' }), async (c) => {
const upstreamUrl = `https://upstream-api.com${c.req.path}`;
const response = await fetch(upstreamUrl, {
method: c.req.method,
headers: c.req.headers,
body: c.req.method !== 'GET' ? await c.req.text() : undefined,
});
return new Response(response.body, {
status: response.status,
headers: response.headers,
});
});
For edge-deployed proxies:
// Cloudflare Workers + MPP proxy pattern
export default {
async fetch(request, env) {
// MPP middleware handles 402 challenge-response
// On successful payment, forwards to upstream
}
};
| Strategy | Description |
|---|---|
| Flat rate | Same price for all requests |
| Endpoint-based | Different prices per API route |
| Payload-based | Price varies by request/response size |
| Metered | Session-based, charged per unit consumed |
| Tiered | Volume discounts (first 100 at $X, next 1000 at $Y) |
Authorization: Payment)Payment-Receipt header to upstream responseRoute to different upstreams based on the path:
const upstreams = {
'/ai/': 'https://api.openai.com',
'/data/': 'https://api.data-vendor.com',
'/search/': 'https://api.search-engine.com',
};
/openapi.json) describing proxied endpointsFetch the latest mppx proxy documentation and Cloudflare MPP integration guide for exact proxy API, configuration options, and edge deployment patterns before implementing.