x402-api-paywall
Add x402 Paywalls to API Routes
Charging agents per API request requires payment checks before protected work runs. This guide outlines x402 integration for FastAPI and Express using stablecoins and external verification.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "x402-api-paywall" from https://skillstore.io/skills/nexaiguy-x402-api-paywall.md and its manifest at https://skillstore.io/api/skills/nexaiguy-x402-api-paywall/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "x402-api-paywall". Plan a 0.10 USDC paywall for a FastAPI image-generation endpoint on Base Sepolia.
Expected outcome:
- Attach a payment dependency only to the selected image-generation route.
- Return HTTP 402 with payment requirements when payment proof is absent.
- Verify payment through a compatible facilitator before running generation.
- Confirm recipient, asset, network, and price configuration before testing.
Using "x402-api-paywall". Describe how to add paid routes to an Express API without changing public routes.
Expected outcome:
- Mount payment middleware on selected paid routes rather than globally.
- Validate payment proof before invoking protected handlers.
- Leave public routes outside the payment middleware.
- Test missing and invalid proofs; verify live behavior separately from mocked tests.
Security Audit
SafeAll five static findings are false positives: attribution links and payment-verification descriptions do not demonstrate reconnaissance or exfiltration. No evidence found of prompt injection or malicious instructions in the single documentation file. The package contains guidance only, so payment implementation security cannot be verified.
Risk Factors
๐ Network access (2)
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/nexaiguy-x402-api-paywall/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/nexaiguy-x402-api-paywall?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/nexaiguy-x402-api-paywall?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/nexaiguy-x402-api-paywall/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/nexaiguy-x402-api-paywall.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA ยท BibTeX ยท CFF)
APA citation
nexaiguy. (2026). x402-api-paywall security audit report (audit version 1) [Author version 1.2]. Skillstore. https://skillstore.io/skills/nexaiguy-x402-api-paywall/audits/1BibTeX citation
@techreport{nexaiguy-nexaiguy-x402-api-paywall-2026,
author = {nexaiguy},
title = {x402-api-paywall security audit report (audit version 1)},
institution = {Skillstore},
year = {2026},
number = {1},
url = {https://skillstore.io/skills/nexaiguy-x402-api-paywall/audits/1},
note = {Author version 1.2}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "x402-api-paywall security audit report (audit version 1)"
version: "1.2"
type: report
authors:
- name: "nexaiguy"
date-released: "2026-11-02"
url: "https://skillstore.io/skills/nexaiguy-x402-api-paywall/audits/1"
identifiers:
- type: other
value: "skillstore:nexaiguy-x402-api-paywall:audit:1"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this score Evidence Confidence: MediumWhat You Can Build
Protect an expensive generation route
Use the guide to plan a FastAPI dependency that checks payment before an image-generation endpoint performs expensive work.
Introduce selective API billing
Plan Express middleware for paid endpoints while keeping public routes unchanged.
Prototype agent micropayments
Explore a test-network USDC payment flow for agents consuming metered services.
Try These Prompts
Explain the x402 request flow for a FastAPI route, including missing proof, HTTP 402 requirements, and facilitator verification.
Plan an x402 paywall for my FastAPI image-generation route at 0.10 USDC on Base Sepolia. Identify required configuration and keep public routes unchanged.
Review my Express routes and propose x402 middleware for selected paid endpoints. Identify a compatible facilitator and verify payment before protected work starts.
Review my x402 integration for proof replay, incorrect payment amounts, network mismatches, and facilitator outages. Propose failure tests and identify unverified settlement assumptions.
Best Practices
- Verify current x402 and facilitator documentation before choosing dependencies or implementing payment checks.
- Validate payment before protected work and confirm recipient, asset, amount, and network.
- Test unpaid, invalid, and successful requests on a test network before enabling production payments.
Avoid
- Treating this public guide as bundled, audited payment middleware.
- Trusting client payment claims without server-side verification.
- Assuming mocked proofs demonstrate successful live payment settlement.