Get the FREE Ultimate OpenClaw Setup Guide →

x402

npx machina-cli add skill csmoove530/clawd-market/x402-skill-package --openclaw
Files (1)
SKILL.md
9.6 KB

x402 Development Skill

You are helping the user build x402-based servers and applications. x402 is a protocol for micropayments over HTTP that enables paid APIs, AI agent commerce, and monetized services.

Your Role

When this skill is active, you should:

  • Help build x402 payment servers and integrations
  • Provide guidance using the resources and best practices below
  • Reference the official documentation and examples when answering questions
  • Suggest appropriate middleware and SDKs based on the user's tech stack
  • Point users to the most relevant GitHub repositories and implementation examples

Core Protocol & Specification

Coinbase x402 – Overview / Welcome https://docs.cdp.coinbase.com/x402/docs/welcome

x402 Foundation – Protocol site https://x402.org

x402 Whitepaper https://x402.org/whitepaper

x402 GitBook (spec + quickstarts) https://x402.gitbook.io/x402

Coinbase x402 GitHub (reference implementation) https://github.com/coinbase/x402

Seller / Server-Side Documentation

Coinbase / CDP

Seller Quickstart (build a paid API) https://docs.cdp.coinbase.com/x402/docs/seller-quickstart

Facilitator documentation (verification + settlement model) https://docs.cdp.coinbase.com/x402/docs/facilitator

x402 + MCP Server (agent-facing paid APIs) https://docs.cdp.coinbase.com/x402/docs/mcp-server

thirdweb

thirdweb x402 Server docs https://portal.thirdweb.com/connect/payments/x402

thirdweb x402 Facilitator docs https://portal.thirdweb.com/connect/payments/x402/facilitator

thirdweb x402 Agent / AI examples https://portal.thirdweb.com/ai/payments/x402

thirdweb x402 Agent Commerce Example Repo https://github.com/thirdweb-example/402-agent-commerce

DayDreams

DayDreams x402 Nanoservice Tutorial https://docs.daydreams.systems/tutorials/x402-server

AI Nanoservice with x402 Payments https://docs.daydreams.systems/tutorials/ai-nanoservice-x402

DayDreams Documentation Hub https://docs.daydreams.systems

DayDreams GitHub Organization https://github.com/daydreamsai

Example project: lootsurvivor (x402 usage) https://github.com/daydreamsai/daydreams-lootsurvivor

Explorers & Ecosystem Discovery

x402scan

x402scan GitHub Repository https://github.com/Merit-Systems/x402scan

x402scan Ecosystem Page https://x402scan.com/ecosystem

The official x402scan ecosystem explorer lists actual running x402 servers on chain and their endpoints, and often links to GitHub. Look under "Node Servers (Hono, Express, Advanced)" for examples with production traffic.

Curated lists & discovery

awesome-x402 (Merit Systems) https://github.com/Merit-Systems/awesome-x402

awesome-x402 (xpaysh) https://github.com/xpaysh/awesome-x402

GitHub topic: x402 https://github.com/topics/x402

x402 Ecosystem Gallery https://x402.org/ecosystem

Best Practices & Production Guidance

Security considerations for x402 (community writeup) https://mirror.xyz/0xJasmin.eth/0cV2Zl3X9q8u2p4Zf8gF9f2k5x402-security

Cloudflare Agents + x402 overview https://developers.cloudflare.com/agents/payments/x402/

QuickNode – x402 crypto paywall tutorial https://www.quicknode.com/guides/web3-payments/x402-paywall

Polygon – x402 Seller Quickstart (Express / Hono / Next) https://wiki.polygon.technology/docs/payments/x402/

Middleware & SDKs (Server-Side Helpers)

x402-fetch (buyer + server helpers) https://github.com/coinbase/x402-fetch

x402 Hono middleware https://github.com/x402xyz/x402-hono

Community middleware & server examples index https://github.com/xpaysh/awesome-x402#middleware

Real-World / Production References

Coinrailz production integration (discussion + code pointers) https://github.com/coinbase/x402/issues/44

Major x402 Server / Protocol Repositories

These are the most prominent GitHub repositories that serve as good x402 server implementations or strong reference examples, especially those with stars, ecosystem visibility, or real usage on x402scan / ecosystem listings.

1) coinbase/x402 — Official reference implementation

Repo: https://github.com/coinbase/x402

  • ~5.2k stars — by far the most popular & referenced x402 implementation
  • Includes: core protocol, middleware for Node (Express, Hono), examples, and reference patterns for server payment gating
  • Excellent base if you want to see how a production-grade protocol handles 402 responses, payload verification, and settlement logic
  • A great reference server pattern — not just a library

2) xpaysh/awesome-x402 — Curated list of x402 ecosystem

Repo: https://github.com/xpaysh/awesome-x402

  • ~114 stars
  • Contains links to multiple server implementations, middleware, examples, and projects using x402
  • Great place to discover well-built x402 servers and tools like Node servers, Rust, Java SDKs, and more

3) Merit-Systems/awesome-x402 — Another curated ecosystem list

Repo: https://github.com/Merit-Systems/awesome-x402

  • Lower star count but broader ecosystem coverage
  • Includes protocol SDKs, examples, and links to community projects that include server patterns and integrations

Notable Language / Framework Implementations

These are less starred but solid codebases that serve as real server or middleware examples:

4) dabit3/a2a-x402-typescript — TypeScript x402 implementation

Repo: https://github.com/dabit3/a2a-x402-typescript

  • ⭐ ~90+ stars
  • A more complete TypeScript implementation supporting A2A (agent-to-agent) patterns with x402
  • Good for seeing how server + client payment logic integrates in a real app

5) microchipgnu/MCPay — MCP + x402 infrastructure

Repo: https://github.com/microchipgnu/MCPay

  • ⭐ ~78 stars
  • Infrastructure that integrates x402 into MCP (Model Context Protocol) commodity services
  • Useful if your server offers paid tools/services that need integrated payment gating

6) AIMOverse/x402-kit — SDK & modular server tooling

Repo: https://github.com/AIMOverse/x402-kit

  • ⭐ ~50+ stars
  • Offers a modular toolkit you can use to spin up x402-enabled servers
  • Might include middleware and patterns that help structure server endpoints

Rust Server Example (Production-Grade)

7) x402-rs/x402-rs — Rust x402 implementation + middleware

Repo: https://github.com/x402-rs/x402-rs

  • Rust implementation with server facilitator, middleware (x402-axum), and client tooling
  • Not as high star count as the Coinbase repo, but a solid server and middleware example in the Rust ecosystem
  • Includes a production-ready HTTP facilitator / verification service which is essentially a server component

Other Community Examples Worth Checking

(Not high-star but real working servers / demos which you might fork)

Quick Summary — Best Repos to Reference

RepositoryStarsWhat It ShowsGood For
https://github.com/coinbase/x402⭐⭐⭐⭐⭐Protocol + server patterns, middlewareOfficial reference
https://github.com/xpaysh/awesome-x402⭐⭐⭐Hub of server examplesDiscovery source
https://github.com/dabit3/a2a-x402-typescript⭐⭐TS server + A2A paymentsReal integration patterns
https://github.com/microchipgnu/MCPay⭐⭐Server + payment infraMCP + x402 combos
https://github.com/AIMOverse/x402-kit⭐⭐SDK + server toolsReusable server tooling
https://github.com/x402-rs/x402-rs⭐⭐Rust server + facilitatorRust ecosystem example

Suggested Reading Order (For New Projects)

  1. Spec & flow

  2. Reference implementation

  3. Server quickstart

  4. Middleware / framework choice

  5. Production patterns

Tech Stack Recommendations

  • Express.js projects: Use x402-fetch or custom middleware
  • Hono projects: Use x402-hono middleware (https://github.com/x402xyz/x402-hono)
  • Next.js projects: Follow Polygon's seller quickstart
  • AI/Agent projects: Reference thirdweb agent examples or DayDreams tutorials
  • MCP servers: Follow Coinbase MCP server documentation
  • TypeScript/A2A: Check out dabit3/a2a-x402-typescript
  • Rust projects: Use x402-rs/x402-rs

Implementation Approach

When helping build x402 integrations:

  1. Understand the user's tech stack and choose appropriate middleware
  2. Follow the seller quickstart pattern for basic setup
  3. Implement facilitator integration for payment verification
  4. Add proper error handling and security considerations
  5. Test with x402scan or ecosystem tools
  6. Reference real-world examples for production patterns
  7. Point to specific GitHub repos based on the tech stack and use case

Source

git clone https://github.com/csmoove530/clawd-market/blob/main/test-e2e/x402-skill-package/SKILL.mdView on GitHub

Overview

x402 is a protocol for micropayments over HTTP that enables paid APIs, AI agent commerce, and monetized services. This skill guides you through building x402-based servers, integrations, and payment infrastructure, with references to official docs, examples, and middleware.

How This Skill Works

You build a server that exposes paid endpoints, integrate the x402 protocol stack, and use facilitator and verification/settlement flows. Use available middleware and SDKs (e.g., x402-fetch, x402-hono) and follow the Seller Quickstart and reference implementations to handle payments, gating, and refunds.

When to Use It

  • When you want to build or deploy a x402-based paid API for monetized services.
  • When you need to integrate x402 payments into an existing server stack (Express, Hono, Next, etc.).
  • When evaluating middleware, SDKs, and examples to accelerate x402 integration.
  • When you want guidance on verification, settlement, and facilitator patterns.
  • When you're exploring the x402 ecosystem, examples, and production references.

Quick Start

  1. Step 1: Read core docs (Coinbase x402 Welcome, x402 Foundation, whitepaper) and pick your tech stack.
  2. Step 2: Follow Seller Quickstart to scaffold a paid API and integrate the facilitator.
  3. Step 3: Add x402-fetch or x402-hono middleware, test payments end-to-end, and iterate.

Best Practices

  • Start with the Seller Quickstart to scaffold a paid API and learn the end-to-end flow.
  • Reference official x402 resources (Coinbase Welcome, x402 Foundation, whitepaper) for protocol details.
  • Choose middleware/SDKs that fit your stack (e.g., x402-fetch, x402-hono) and follow their usage patterns.
  • Understand and implement facilitator verification/settlement models early in design.
  • Review production examples (DayDreams, x402scan, Polygon seller quickstarts) to inform architecture.

Example Use Cases

  • DayDreams lootsurvivor project demonstrates x402 usage for monetized endpoints.
  • Thirdweb Agent Commerce Example Repo showcases paid API and agent flows with x402.
  • Coinbase x402 GitHub reference implementation provides server-side patterns.
  • x402scan ecosystem pages show real nodes/endpoints in production.
  • Polygon x402 Seller Quickstart examples illustrate Express/Hono/Next integrations.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers