# x402 Paywall

> Add per-call USDC paywalls (x402 v2) to any HTTP API or MCP tool: correct 402 challenges, facilitator routing, price checks, and where to list the paid endpoint.

x402 Paywall is a free AI agent skill on Agensi by Temka, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Temka](https://www.agensi.io/creators/temka)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Uses: 6
- Version: 1.0
- Last updated: 2026-09-17
- Security: scan passed (2026-09-17); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/x402-paywall
- Tags: api, rest-api, backend, web3, evm, payments, usdc, x402

## About this skill

### Add per-call USDC payment to any HTTP API

This skill turns a plain endpoint into an agent-payable one: the first call returns `402 Payment Required` with an x402 v2 challenge, the caller signs a USDC authorization, retries with a `PAYMENT-SIGNATURE` header, and your server settles through a facilitator and serves the response. No accounts, no API keys, no signup on the buyer side.

### Why it is different

Most published x402 material still describes v1 (`X-PAYMENT`, `maxAmountRequired`, network `base`). 98% of live registry resources already speak v2 (measured across 1000 listings on 17 Sep 2026), so paywalls copied from tutorials fail on the first call. This skill is written against the v2 specification, validated against a live Base-mainnet seller endpoint, and ships a checker that tells you exactly why a challenge is rejected.

### What you get

- `SKILL.md` - the seller-side workflow: unit pricing, receiving address, the 402 challenge, verify then serve then settle ordering, receipts, replay protection.
- `references/x402-protocol-notes.md` - v2 field semantics, CAIP-2 networks, facilitator routing, and the trap that breaks first deployments: `x402.org/facilitator` settles testnets only for EVM, so a Base-mainnet paywall pointed at it can never settle.
- `references/catalog-listing.md` - where to list the paid endpoint (CDP Bazaar, PayAI, Circle Gateway) and what listing copy to use.
- `scripts/check_paywall.py` - validates a live endpoint's 402 challenge: header vs body, network, USDC contract, atomic-unit price, facilitator support. Distinguishes hard failures from warnings.
- `tests/self_test.py` - 8 mock cases (v2 in header, v2 body-only, v1 network label, wrong USDC contract, legacy v1, free route, POST-only route, price mismatch).

### Field-level details it carries

Atomic-unit prices as strings, the EIP-712 `extra` domain, exact `resource.url` matching, `maxTimeoutSeconds`, `PAYMENT-RESPONSE` settlement receipts with `success`/`errorReason`, and facilitator `/supported` kind checks.

### Requirements

Python 3.9+ for the checker. No packages to install, no credentials, no private keys - the skill only needs the receiving address you already control.

## Known limitations

Seller side only - it does not implement the buyer's wallet. Legacy v1 clients are covered by a compatibility table, not by new v1 code.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the x402 Paywall skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does the x402 Paywall skill actually do for my API?

This skill provides the complete implementation logic and validation scripts to add x402 v2 paywalls to your APIs, allowing AI agents to pay you in USDC per request without requiring API keys or user accounts.

### How does this differ from standard x402 implementation tutorials found online?

Unlike v1 tutorials that often fail on modern registries, this skill is built for the v2 specification used by 98% of live resources, including updated EIP-712 domain handling and facilitator routing for Base-mainnet.

### What specific files and resources are included in this package?

You receive a seller-side workflow guide, protocol notes for v2 field semantics, a catalog listing guide for top AI marketplaces, and a Python-based validation script to test your live endpoint's challenges.

### How can I verify that my paywall is correctly configured before listing it?

The included check_paywall.py script validates your endpoint's 402 challenge, ensuring headers, network IDs, USDC contracts, and facilitator support are correctly configured before you go live.

### Can I use this skill to monetize MCP tools?

Yes, it is designed to work with any HTTP-based API or Model Context Protocol (MCP) tool, making your existing technical tools instantly monetizable for autonomous AI agents.

### What are the technical requirements to use the validator and implementation guides?

The checker requires Python 3.9+, but no external packages, private keys, or complex credentials are needed; you only need the public receiving address where you want to collect USDC.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
