Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add gblinproject/gblin-treasury-risk-regime --skill x402-paywall-patterngit clone --depth 1 https://github.com/gblinproject/gblin-treasury-risk-regimeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/gblinproject/gblin-treasury-risk-regime/x402-paywall-pattern)<a href="https://agentmods.dev/skills/gblinproject/gblin-treasury-risk-regime/x402-paywall-pattern"><img src="https://agentmods.dev/badge/skills/gblinproject/gblin-treasury-risk-regime/x402-paywall-pattern/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/gblinproject/gblin-treasury-risk-regime/x402-paywall-pattern"><img src="https://agentmods.dev/badge/skills/gblinproject/gblin-treasury-risk-regime/x402-paywall-pattern.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00061 | $0.01674 |
| Opus 5 | $0.00030 | $0.00837 |
| Sonnet 5 | $0.00012 | $0.00335 |
| Haiku 4.5 | $0.00006 | $0.00167 |
Grade A, and why
x402-paywall-pattern scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
const response = await fetch(url); How it starts
The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.
x402 Paywall Pattern for MCP Servers and APIs
When this skill applies
Trigger when the user describes any of:
- "Add a paywall to my MCP server"
- "Charge per tool call"
- "Monetize my AI agent's API"
- "Accept USDC micropayments"
- "x402 implementation"
- "How do I get paid for my MCP tools?"
Architecture overview
x402 is Coinbase's HTTP 402 payment protocol. When a client (typically an AI agent) calls a paywalled endpoint without payment, the server returns HTTP 402 with a JSON manifest. The client signs an EIP-3009 transferWithAuthorization USDC transfer, embeds the signed payload in the X-Payment header, and retries.
Client → GET /api/my-tool
Server → 402 { amount, currency, recipient, facilitator, ... }
Client → signs EIP-3009 with USDC
Client → GET /api/my-tool, header X-Payment: <base64>
Server → verifies, executes, returns 200 with result
Reference implementation
// src/middleware/x402-paywall.ts
import type { NextApiRequest, NextApiResponse } from 'next';
const USDC_BASE = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
const FACILITATOR = process.env.X402_FACILITATOR_URL || 'https://x402.org/facilitator';
interface PaywallConfig {
price: string; // USDC amount, e.g. "0.01"
recipient: string; // Your wallet address
description?: string;
}
export function withPaywall(handler: (req: NextApiRequest, res: NextApiResponse) => Promise<void>, config: PaywallConfig) {
return async (req: NextApiRequest, res: NextApiResponse) => {
const paymentHeader = req.headers['x-payment'] as string | undefined;
if (!paymentHeader) {
res.setHeader('Content-Type', 'application/json');
return res.status(402).json({
amount: config.price,
currency: 'USDC',
currencyAddress: USDC_BASE,
chain: 'base',
chainId: 8453,
recipient: config.recipient,
facilitator: FACILITATOR,
description: config.description || 'Payment required',
});
}
let proof: any;
try {
proof = JSON.parse(Buffer.from(paymentHeader, 'base64').toString('utf-8'));
} catch {
return res.status(400).json({ error: 'invalid_payment_header' });
}
if (!proof.signature || !proof.payer || !proof.amount) {
return res.status(402).json({ error: 'invalid_payment' });
}
if (proof.expiresAt && proof.expiresAt < Date.now() / 1000) {
return res.status(402).json({ error: 'payment_expired' });
}
return handler(req, res);
};
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 175 lines · 61 tokens per session scan A 794993808046
x402-paywall-pattern is a skill published in the GitHub repository gblinproject/gblin-treasury-risk-regime (1 stars, last pushed yesterday), licensed MIT. It adds 61 tokens to every session and 1,674 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
wealthville
Score Solana and EVM liquidity pools before providing liquidity. Returns a 0-100 pool score, an ENTER/HOLD/EXIT/REDUCE/AVOID verdict with calibrated confidence, and a public miss-inclusive track record. Use when a user asks whether a pool is worth LPing into, which pools currently look best, or how the scores have…
pump-swarm
Coordinated multi-wallet trading on Pump.fun.
trading-solana
Trade tokens on Solana DEXes - Jupiter, Raydium, Orca, Meteora, Pump.fun.
bridge
Cross-chain token transfers using Wormhole and CCTP.
hyperliquid
Hyperliquid L1 perps DEX (69% market share).
pumpfun
Pump.fun - Complete Solana memecoin launchpad. Discovery, trending, gainers, losers, token data all work without a key. Trading requires SOLANAPRIVATEKEY.