skills/ai/x402/SKILL.md
Use when implementing the x402 protocol for HTTP-native micropayments. Covers server middleware, client payment flows, facilitator integration, and stablecoin payments for APIs and AI agents. USE FOR: API micropayments, monetizing endpoints, stablecoin HTTP payments, automated agent payments for API access DO NOT USE FOR: full commerce flows with cart/checkout (use ap2), agent communication (use a2a), tool integration (use mcp)
npx skillsauth add Tyler-R-Kendrick/agent-skills x402Install this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
x402 is an open payment protocol from Coinbase that revives the HTTP 402 (Payment Required) status code for instant, automatic stablecoin micropayments. It enables APIs and services to be monetized natively over HTTP — no accounts, sessions, or traditional payment processors required. Both human clients and AI agents can pay programmatically.
Client Server Facilitator
│ │ │
│── GET /weather ──────────────►│ │
│◄── 402 Payment Required ─────│ │
│ (price, payTo, network) │ │
│ │ │
│── sign payment ──────────────►│ │
│ (PAYMENT-SIGNATURE header) │── verify + settle ────────►│
│ │◄── confirmation ────────────│
│◄── 200 OK (content) ─────────│ │
import { paymentMiddleware, x402ResourceServer } from "@x402/express";
import { ExactEvmScheme } from "@x402/evm/exact/server";
import { HTTPFacilitatorClient } from "@x402/core/server";
const resourceServer = new x402ResourceServer(
new HTTPFacilitatorClient({ url: "https://x402.org/facilitator" })
);
resourceServer.register("eip155:84532", new ExactEvmScheme());
app.use(paymentMiddleware(
{
"GET /weather": {
accepts: {
scheme: "exact",
price: "$0.001",
network: "eip155:84532",
payTo: "0xYourAddress",
},
},
},
resourceServer,
));
from flask import Flask
from x402.flask.middleware import PaymentMiddleware
app = Flask(__name__)
payment_middleware = PaymentMiddleware(app)
payment_middleware.add(
path="/weather",
price="$0.001",
pay_to_address="0xYourAddress",
network="base-sepolia",
)
@app.route("/weather")
def get_weather():
return {"report": {"weather": "sunny", "temperature": 70}}
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client()
.register("eip155:*", new ExactEvmScheme(privateKeyToAccount(privateKey)));
let response = await fetch(url);
if (response.status === 402) {
const paymentRequired = decodePaymentRequiredHeader(
response.headers.get("PAYMENT-REQUIRED")
);
const payload = await client.createPaymentPayload(paymentRequired);
response = await fetch(url, {
headers: { "PAYMENT-SIGNATURE": encodePaymentSignatureHeader(payload) },
});
}
from eth_account import Account
from x402.clients.httpx import x402HttpxClient
account = Account.from_key(os.getenv("PRIVATE_KEY"))
async with x402HttpxClient(account=account, base_url="https://api.example.com") as client:
response = await client.get("/protected-endpoint")
| Header | Direction | Description |
|--------|-----------|-------------|
| PAYMENT-REQUIRED | Response (402) | Payment terms (price, payTo, network, scheme) |
| PAYMENT-SIGNATURE | Request (retry) | Signed payment payload |
x402 works with fast, low-fee blockchains:
"$0.001") — the protocol handles conversion.https://x402.org/facilitator) for verification and settlement.tools
Use when building or maintaining a design system — the coordinated set of design tokens, component libraries, documentation, and tooling that ensures visual and behavioral consistency across products. USE FOR: design system architecture, choosing token formats vs component frameworks, connecting Figma to code, design-to-development workflows, multi-platform consistency DO NOT USE FOR: specific token authoring (use design-tokens), Figma workflows (use figma), component cataloging (use storybook), token transformation (use style-dictionary), cross-framework components (use mitosis)
tools
Use when implementing or integrating with the Model Context Protocol (MCP) for AI tool servers, resources, prompts, and context management. USE FOR: building MCP tool servers, exposing resources to agents, prompt templates, connecting agents to external APIs DO NOT USE FOR: agent-to-agent communication (use a2a), interactive UI rendering (use mcp-apps), agent payments (use x402 or ap2)
tools
Use when building MCP Apps that serve interactive UI from MCP servers. Covers the ui:// URI scheme, HTML rendering in sandboxed iframes, and bidirectional communication between UI and host. USE FOR: rich UI in agent conversations, interactive dashboards from MCP servers, sandboxed iframe rendering DO NOT USE FOR: basic tool responses without UI (use mcp), agent communication (use a2a), full web applications
data-ai
Use when a user corrects, rejects, edits, or redirects an LLM/agent response and the correction should become a reusable reasoning strategy. Converts feedback into generalized learnings for ~/.agents/STEERING.md with linked RDF/Turtle evidence. USE FOR: user corrections, preference feedback, rejected agent behavior, reasoning strategy updates, steering file maintenance DO NOT USE FOR: storing task facts (use memory), ordinary skill authoring (use agent-skills), project instruction files unrelated to feedback (use agents-md)