x402-payments

Detect protected API routes and validate cryptocurrency payments via middleware.

443|88|Updated Feb 18, 2024
One-click install
npx skills add https://github.com/nirholas/XActions --skill x402-payments-nirholas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: x402-payments
Source: https://github.com/nirholas/XActions/tree/main/skills/x402-payments
Command: npx skills add https://github.com/nirholas/XActions --skill x402-payments-nirholas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables secure, pay-per-use access to API routes using cryptocurrency, allowing monetization without traditional subscriptions or keys.

Core Features & Use Cases

  • Multi-chain support across Base, Ethereum, Polygon, and Arbitrum
  • Per-endpoint pricing with on-chain payment verification to protect resources
  • Middleware and tooling to discover, negotiate, and validate payments for API calls

Quick Start

Configure your API to apply x402 payments to protected routes and enable auto-payment handling for compliant clients.

Frequently Asked Questions about x402-payments

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I monetize API endpoints with cryptocurrency on a per-request basis?

You can monetize API endpoints with cryptocurrency by applying x402 pay-per-use middleware to protected routes, enabling clients to negotiate and validate on-chain payments for individual API calls without traditional API keys or subscriptions.

What is the HTTP 402 payment mechanism for multi-chain API access?

The HTTP 402 mechanism is a middleware pattern that intercepts protected API routes, returning a 402 status when payment is needed, and validating on-chain cryptocurrency payments before processing the request.

Can I configure per-route pricing across different blockchain networks like Ethereum and Polygon?

Yes, you can configure per-route pricing across multiple blockchain networks including Base, Ethereum, Polygon, and Arbitrum by providing a networks and tokens pricing configuration within the payment middleware.

How do I add crypto paywall protection to existing API middleware?

To add crypto paywall protection, integrate the x402 middleware component to detect protected routes, respond with 402 when payment is required, and verify on-chain payments before forwarding the request to your API.

Does API cryptocurrency payment verification require traditional API keys or subscriptions?

No, API cryptocurrency payment verification replaces traditional API keys and subscriptions by using on-chain payment validation through middleware to secure pay-per-use access to your endpoints.

What limitations exist when using on-chain verification for pay-per-use API access?

On-chain verification for pay-per-use API access requires clients to support compliant auto-payment handling, meaning standard HTTP clients without native cryptocurrency negotiation capabilities cannot process the 402 payment responses.