AI developer skills for implementing the x402 stateless settlement-gated HTTP protocol
x402-developer-skills is an early-stage JavaScript project in the AI payments / x402 ecosystem. It currently has 2 GitHub stars and 1 forks.
x402 allows any HTTP API to accept instant per-request payments without accounts or billing systems.
Traditional payment APIs require merchant onboarding, user registration, API keys, and billing ledgers. Payment channels and token systems require off-chain state and additional infrastructure.
x402 removes all of that.
The payment happens directly in the HTTP request cycle.
Flow • Client requests a protected endpoint • Server responds 402 Payment Required with a challenge • Client pays on-chain • Client retries the request with payment proof • Server executes the request
No: • accounts • API keys • subscriptions • balance tracking • intermediaries
Just HTTP + a Bitcoin transaction per request.
Designed for: • machine-to-machine micropayments • pay-per-request AI APIs • monetized public endpoints AI developer skills enabling correct implementation of the x402 stateless settlement-gated HTTP protocol.
Structured protocol skills for AI coding systems (Claude Code, Cursor, agent environments) to:
The x402 wire protocol is frozen for v0.1. Challenge and proof structures, canonical hashing, delegator fields, and HTTP status semantics are stable. See Protocol Stability and Wire Format Quick Reference for details.
These skills are derived from:
When ambiguity exists: protocol spec > reference implementation > these skills
skills/
protocol/ Protocol architecture and mechanics
explain-x402-protocol/SKILL.md
architecture-overview/SKILL.md
protocol-flow/SKILL.md
deterministic-binding/SKILL.md
replay-protection/SKILL.md
client/ Building x402 clients
build-x402-client/SKILL.md
call-x402-api/SKILL.md
construct-payment-transaction/SKILL.md
server/ Server-side integration
add-x402-to-http-api/SKILL.md
implement-gateway/SKILL.md
verify-payment-proof/SKILL.md
infrastructure/ Deploying and operating components
run-x402-gateway/SKILL.md
run-delegator/SKILL.md
operate-nonce-mint/SKILL.md
security/ Protocol invariant enforcement
validate-proof/SKILL.md
detect-double-spend/SKILL.md
enforce-request-binding/SKILL.md
discovery/ Service discovery
implement-x402-discovery/SKILL.md
examples/
go/ Go examples (client, middleware, discovery)
node/ TypeScript examples (client, middleware, discovery)
python/ Python examples (client, gateway, discovery)
rust/ Rust examples (client, middleware) — requires Rust 1.75+
templates/
gateway-template/ Go gateway project scaffold
client-template/ TypeScript client project scaffold
docs/
protocol-summary.md Wire format quick reference
integration-guide.md Step-by-step integration guide
Install the x402 developer skills into your AI coding tools with one command:
npx @merkleworks/x402-skills install
This copies skills into:
~/.claude/skills/x402 (Claude Code)~/.cursor/skills/x402 (Cursor)Other commands:
npx @merkleworks/x402-skills update # Reinstall with latest version
npx @merkleworks/x402-skills uninstall # Remove installed skills
npx @merkleworks/x402-skills doctor # Diagnose and repair environment
npx @merkleworks/x402-skills init myapp # Scaffold a new x402 project
After installing, skills are automatically available. Reference them with:
@x402/protocol/explain-x402-protocol
Add the skills directory to your project context for AI-assisted x402 implementation.
x402 is a stateless settlement-gated HTTP protocol. Core properties:
Normative specification https://github.com/merkleworks/x402-spec
Reference implementation https://github.com/merkleworks/x402-reference
These documents define the authoritative protocol behavior.
When resolving ambiguity: specification > reference implementation > these skills.
Services supporting x402 should expose a discovery endpoint at:
GET /.well-known/x402
This returns a JSON document listing all payable endpoints, their prices, and acceptance policies. AI agents can fetch this endpoint to automatically discover and pay for x402-gated APIs without prior configuration.
See skills/discovery/implement-x402-discovery/SKILL.md for the full specification.
bsv-tx-v1
| Header | Direction | Purpose |
|---|---|---|
X402-Challenge |
Server -> Client | Base64url-encoded challenge JSON |
X402-Proof |
Client -> Server | Base64url-encoded proof JSON |
X402-Accept |
Server -> Client | Supported payment schemes |
X402-Receipt |
Server -> Client | SHA256(txid + ":" + challenge_sha256) |
X402-Status |
Server -> Client | Mempool status: accepted, pending, rejected, error |
The agent-native LLM router for autonomous agents. 55+ models (8 free), <1ms local routing, USDC payments on Base & Solana via x402.
A payments protocol for the internet. Built on HTTP.
A local-first AI agent with persistent memory, emotional intelligence, and a peer-to-peer skills economy.
The trust layer for agent-to-agent commerce — natural-language mandates, ERC-7710 delegated permissions, x402 payments, escrow, and dispute resolution as one open, catch-all Agent Skill / Claude Code plugin.
Self-healing infrastructure for AI agent payments. 90.3% auto-recovery.
The AI agent with a wallet — spends USDC autonomously to get real work done. Apache-2.0, TypeScript.