A Claude Code skill that provides expert guidance for building x402-based servers and applications. x402 is a protocol for micropayments over HTTP that enables paid APIs, AI agent commerce, and monetized services.
This is a Claude Code Skill - a specialized knowledge module that automatically activates when you're working with x402 protocol implementations. When active, Claude will have instant access to:
- Comprehensive x402 documentation and resources
- Best practices for server implementation
- Framework-specific middleware recommendations
- Production-ready examples and reference implementations
- Security considerations and patterns
- Automatic Activation: The skill activates when you mention x402, paid APIs, micropayments, or related concepts
- Framework Recommendations: Get middleware suggestions based on your tech stack (Express, Hono, Next.js, Rust, etc.)
- Curated Resources: Access to the best x402 repositories, tutorials, and documentation
- Implementation Guidance: Step-by-step help for building x402 payment servers
- Production Patterns: Real-world examples and best practices
- Claude Code CLI installed (version 2.0+)
-
Clone this repository:
git clone https://github.com/csmoove530/claude-code-x402-skill.git
-
Copy the skill to your Claude Code skills directory:
cp -r claude-code-x402-skill/x402 ~/.claude/skills/ -
Verify installation:
ls ~/.claude/skills/x402/ # Should show: SKILL.md
-
Restart Claude Code for the skill to be recognized.
If you prefer to install manually:
-
Create the skill directory:
mkdir -p ~/.claude/skills/x402 -
Download the skill file:
curl -o ~/.claude/skills/x402/SKILL.md \ https://raw.githubusercontent.com/csmoove530/claude-code-x402-skill/main/x402/SKILL.md -
Restart Claude Code.
Simply type /x402 in your Claude Code conversation:
You: /x402 - I want to build a paid API using Express.js
Claude: [Activates x402 skill and provides Express.js-specific guidance with
middleware recommendations, code examples, and best practices]
Just mention x402 or related concepts in your conversation:
You: Help me implement x402 payments for my Next.js app
Claude: [Automatically activates the skill and provides Next.js-specific guidance]
The skill activates when you mention:
- "build x402 server"
- "implement x402"
- "add x402 payments"
- "x402 protocol"
- "micropayments"
- "paid API"
- "402 payment required"
- "monetized APIs"
- "AI agent commerce"
- "payment-gated services"
When the skill is active, Claude will help you with:
- Express.js: x402-fetch or custom middleware
- Hono: x402-hono middleware
- Next.js: Polygon's seller quickstart patterns
- AI/Agent projects: thirdweb and DayDreams examples
- MCP servers: Coinbase MCP integration patterns
- Rust: x402-rs implementation and middleware
The skill includes links to:
- Official x402 documentation (Coinbase, x402.org)
- Framework-specific middleware and SDKs
- Production examples and reference implementations
- Security best practices
- Ecosystem tools (x402scan, awesome-x402 lists)
Step-by-step help with:
- Setting up payment-gated endpoints
- Integrating facilitator services
- Implementing proper error handling
- Testing with x402scan
- Deploying to production
You: /x402 - Build me a paid API endpoint with Express.js
Claude: I'll help you create an x402-enabled Express.js server. Based on your
stack, I recommend using x402-fetch middleware...
[Provides complete implementation with code examples, configuration, and testing steps]
You: I have a Hono server and want to add x402 payments
Claude: For Hono servers, the x402-hono middleware is your best option...
[Provides Hono-specific implementation with middleware setup and examples]
You: /x402 - How do I create an MCP server with paid tool access?
Claude: For MCP servers with x402 payments, Coinbase provides excellent
documentation. Let me walk you through the setup...
[Provides MCP-specific guidance with tool configuration and payment integration]
The skill provides access to:
- Core Protocol Documentation: Official specs, whitepapers, and protocol sites
- Seller/Server Documentation: Quickstarts for Coinbase, thirdweb, and DayDreams
- Ecosystem Discovery: x402scan, awesome-x402 lists, production examples
- Best Practices: Security considerations, production patterns, deployment guides
- Major Repositories: Curated list of the best x402 implementations and examples
- Framework Integration: Language and framework-specific guidance
To verify the skill is installed correctly:
- Start Claude Code
- Type
/x402or mention "x402 protocol" - Claude should recognize the trigger and activate the skill
- You'll receive x402-specific guidance and resource recommendations
-
Check file structure:
ls -la ~/.claude/skills/x402/ # Should show SKILL.md with proper permissions
-
Verify file format:
head -5 ~/.claude/skills/x402/SKILL.md # Should show YAML frontmatter with --- delimiters
-
Restart Claude Code:
- Exit current session
- Start a new session
- Try activating again with
/x402
chmod 644 ~/.claude/skills/x402/SKILL.mdContributions are welcome! Here's how you can help:
- Found outdated links or resources? Open an issue
- Skill not activating properly? Let us know your setup
- Missing important x402 resources? Suggest additions
- Fork the repository
- Create a feature branch (
git checkout -b feature/add-resource) - Update
x402/SKILL.mdwith your changes - Test the skill locally
- Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
- x402.org - Protocol site
- Coinbase x402 Docs - Official documentation
- x402 GitBook - Specifications and quickstarts
- awesome-x402 (xpaysh) - Curated ecosystem list
- awesome-x402 (Merit Systems) - Another great list
- x402scan - Ecosystem explorer
MIT License - see LICENSE file for details.
This skill aggregates resources from the x402 community, including:
- Coinbase and the x402 protocol team
- thirdweb for agent commerce patterns
- DayDreams for nanoservice tutorials
- Merit Systems for x402scan ecosystem explorer
- All contributors to awesome-x402 lists
Claude Code Skills are specialized knowledge modules that enhance Claude's ability to help with specific domains. Learn more about creating skills in the Claude Code documentation.
Built with Claude Code | Report Issues | View Source