Agent skill

x402-payments

Enable and integrate x402 crypto payment protocol for XActions API access. Supports multi-chain, multi-token payments for pay-per-use API calls. Use when users want to pay for XActions operations with crypto or integrate x402 into their own agent/app.

Stars 197
Forks 39

Install this agent skill to your Project

npx add-skill https://github.com/nirholas/XActions/tree/main/skills/x402-payments

Metadata

Additional technical details for this skill

author
nichxbt
version
1.0

SKILL.md

x402 Payments

XActions supports the x402 payment protocol — an HTTP-native micropayment standard for pay-per-use API access with cryptocurrency.

Entry Points

Goal Route Method
Discover payment capabilities GET /.well-known/x402 Public
Get OpenAPI spec with payment info GET /api/x402/openapi Public
Make a paid API call Any protected route REST API (with x402 headers)

Configuration

Config lives in api/config/x402-config.js. Key settings:

js
{
  networks: ['base', 'ethereum', 'polygon', 'arbitrum'],  // Supported chains
  tokens: {
    base: ['USDC', 'ETH'],
    ethereum: ['USDC', 'USDT', 'ETH'],
    polygon: ['USDC', 'MATIC'],
    arbitrum: ['USDC', 'ETH'],
  },
  pricing: {
    'POST /api/operations/unfollow': { amount: '0.01', token: 'USDC' },
    'POST /api/operations/follow':   { amount: '0.005', token: 'USDC' },
    // ... per-route pricing
  }
}

Discovery (/.well-known/x402)

Returns a JSON manifest describing all payable routes, supported networks, and token addresses:

bash
GET https://api.xactions.io/.well-known/x402

Response includes:

  • List of payable API endpoints with prices
  • Supported blockchain networks
  • Token contract addresses per network
  • Payment verification endpoint

Making a Paid Request

x402-compatible clients handle payment automatically. For manual integration:

bash
# 1. Get payment requirements (HTTP 402 response)
POST /api/operations/unfollow → 402 Payment Required
  X-Payment-Required: { amount, token, network, recipient }

# 2. Submit on-chain payment + proof
POST /api/operations/unfollow
  X-Payment: <signed-payment-proof>

Middleware

api/middleware/x402.js handles:

  • Detecting x402-protected routes
  • Returning 402 Payment Required with payment details
  • Verifying payment proofs before processing requests
  • Multi-chain verification across Base, Ethereum, Polygon, Arbitrum

Supported Clients

Any x402-compatible client works automatically:

  • x402-axios — Axios adapter with auto-payment
  • x402-fetch — Fetch adapter with auto-payment
  • Claude agents with x402 MCP tools
  • Custom implementations following the x402 spec

Notes

  • x402 payments are per-request — no subscription needed
  • Payment proofs are cryptographically verified on-chain before operations run
  • Use /.well-known/x402 for discovery in agent applications
  • Stripe billing (billing-management skill) remains an alternative for subscription access

Related Skills

  • billing-management — Stripe subscription-based payment alternative
  • xactions-mcp-server — MCP server that uses x402 for AI agent access
  • a2a-multi-agent — Agent-to-agent workflows that use x402 for payment

Expand your agent's capabilities with these related and highly-rated skills.

nirholas/XActions

articles-longform

Compose, preview, publish, and manage long-form Articles on X/Twitter. Premium+ feature. Includes article creation, formatting, media insertion, and performance tracking. Use when users want to write, publish, manage, or analyze X Articles.

197 39
Explore
nirholas/XActions

x-pro-management

Navigate to X Pro (TweetDeck), set up monitoring columns, and manage multi-column view. Use when users want to use X Pro / TweetDeck features or set up a multi-column dashboard.

197 39
Explore
nirholas/XActions

business-ads

Manages X/Twitter business intelligence including brand monitoring, audience insights, competitor analysis, tweet A/B testing, auto-plug replies for promotion, and content performance optimization. Use when users want brand monitoring, audience analysis, competitor comparison, or promotion optimization on X.

197 39
Explore
nirholas/XActions

engagement-interaction

Automates X/Twitter engagement actions — like, unlike, reply, bookmark, hide replies, and auto-like by keyword. Also bulk-unlikes all posts. Use when users want to automate likes, send replies, manage bookmarks on tweets, hide replies, or clear their entire likes history.

197 39
Explore
nirholas/XActions

unfollow-management

Mass unfollow on X/Twitter via browser console scripts. Unfollows everyone, only non-followers, non-followers with username logging, smart time-based unfollow with whitelists, and follow/following ratio management. Use when cleaning up a following list, removing non-followers, bulk unfollowing accounts, or optimizing your follow ratio.

197 39
Explore
nirholas/XActions

follower-monitoring

Monitors X/Twitter follower changes using browser console scripts. Detects who unfollowed, tracks new followers with welcome messages, monitors any public account, runs continuous monitoring with alerts, tracks follower growth over time, and analyzes follower demographics. Use when tracking follower changes, detecting unfollowers, or monitoring Twitter accounts.

197 39
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results