Agent skill · software engineering · affaan-m
agent-payment-x402
Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk, X Layer through OKX Payments / OKX Agent Payments Protocol, and Solana plus multi-network EVM through the upstream x402 packages with facilitator-based settlement. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.
Why this skill is useful
Adds executable scripts for managing payments and spending policies using the x402 protocol, which are not commonly found in public documentation.
What it needs
Requires agentwallet-sdk, okx installed locally. Requires okx account access. About 11k tokens when loaded. Last updated 2026-08-06. 238,342 stars on the source repository.
What this skill does
Agent Payment Execution (x402) Enable AI agents to make policy-gated payments with built-in spending controls. Uses the x402 HTTP payment protocol and MCP tools so agents can pay for external services, APIs, or other agents without custodial risk. When to Use Use when: your agent needs to pay for an API call, purchase a service, settle with another agent, enforce per-task spending limits, or manage a non-custodial wallet. Pairs naturally with cost-aware-llm-pipeline and security-review skills. Decision Tree Choose the integration path based on whether your agent is buying access to a paid API or charging others for one: Need Recommended path ------ ------------------ Agent pays a 402-gated API on Base or another agentwallet-supported chain Use agentwallet-sdk as an MCP payment server with strict spending policy Agent pays a 402-gated API on X Layer Use OKX Agent Payments Protocol from okx/onchainos-skills; okx-x402-payment is a deprecated legacy alias Agent pays a 402-gated API on Solana or another x402 v2 network Wrap the agent's HTTP client with the upstream @x402/fetch or @x402/axios package and register the EVM/SVM schemes; the resource server's facilitator verifies and settles API charges agents on Solana or multiple networks (TypeScript, Python, or Go) Use the upstream x402 middleware from x402-foundation/x402 — @x402/express, @x402/hono, @x402/next, or @x402/fastify for TypeScript, x402 for Python, github.com/x402-foundation/x402/go/v2 for Go TypeScript API charges agents Use OKX Payments TypeScript seller SDK docs for Express, Hono, Fastify, or Next.js Go API charges agents Use OKX Payments Go seller SDK docs for Gin, Echo, or net/http Rust API charges agents Use OKX Payments Rust seller SDK docs for Axum Java API charges agents Use OKX Payments Java seller SDK docs for Spring Boot 2/3, Java EE, or Jakarta Python API charges agents Check the current OKX Payments repository before implementation; a Python seller guide may not be available Supported Networks a …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills affaan-m/agent-payment-x402--55f29a