Documentation Index
Fetch the complete documentation index at: https://docs.x402layer.cc/llms.txt
Use this file to discover all available pages before exploring further.
OpenClaw x402-Layer Skill
The x402-layer skill enables OpenClaw agents to interact with x402 Singularity Layer for autonomous API monetization and consumption.This skill is production-ready and has been tested with real payments on Base (EVM) and Solana, including the current PayAI-backed Solana flow.
Current release: v1.12.0. This release adds API schema support for endpoint route documentation, enabling agents to self-discover routes from 402 challenges, powering interactive API testers on pay pages, and displaying route docs on marketplace listings.
Script Source Code
The full Python source code for all scripts is available in this repository: View Scripts Folder- Consumer Mode
- Provider Mode
- Agent Registry
Scripts for buying services from the marketplace:
| Script | Purpose | Source |
|---|---|---|
pay_base.py | Pay for endpoints on Base (recommended default) | View Code |
pay_solana.py | Pay for endpoints on Solana with the sponsored PayAI flow | View Code |
consume_credits.py | Use pre-purchased credits (fastest) | View Code |
consume_product.py | Purchase digital products (files) | View Code |
check_credits.py | Check your credit balance | View Code |
recharge_credits.py | Buy credit packs for an endpoint | View Code |
discover_marketplace.py | Browse available services | View Code |
ows_cli.py | Run OpenWallet / OWS wallet, pay, discover, sign-message, and agent-key commands | View Code |
Quick Start
Installation
Install directly via our self-hosted endpoint:Environment Setup
X-API-Key when the agent already has the direct worker-management key for endpoint, webhook, or fundraiser campaign management.
Studio seller webhooks useX-X402-Signature,X-X402-Timestamp,X-X402-Event, andX-X402-Event-Id. VerifyHMAC-SHA256(timestamp + "." + rawBody)with the webhooksigning_secret. Keep legacy raw-secret headers only as fallback for older receivers, and do not confuse the Studio signing secret with any app-internal settlement secret such asx-x402-secret→X402_WEBHOOK_SECRET.
World AgentKit Benefits
XMTP Support Threads
Usage Examples
Integrate Payments Into Your App
Pay for an Endpoint (Consumer)
Use Credits (Fastest)
Create Your Own Endpoint (Provider)
Note: Save the API Key from the output and use it to secure your origin server.
Add API Schema Documentation
Attach a schema so consumers and agents know what routes, parameters, and body fields your API supports:{"version": 1, "routes": [...]} where each route specifies path, method, summary, parameters (with name, in, type, required, example), optional requestBody, and optional responseExample.
When set, the schema:
- Displays on marketplace listings
- Is included in 402 challenge responses for programmatic discovery
- Powers the interactive API tester on hosted pay pages
Security: API Key Verification
[!IMPORTANT] When you create an endpoint, x402 acts as a proxy to your origin server. You MUST verify requests are coming from x402.
- Get your API Key: Returned when you run
create_endpoint.py. - Verify Headers: Your origin server MUST check for this header in every request:
If the header is missing or incorrect, reject the request (401 Unauthorized).
Browse Marketplace
Register an Agent (Wallet-First)
register_agent.pyrequests a one-time challenge fromPOST /agent/auth/challenge- Your wallet signs the challenge locally
- The script exchanges that signature at
POST /agent/auth/verify - The worker returns a short-lived session token
list_my_endpoints.pyandlist_agents.pyuse wallet-authenticatedGET /agent/erc8004/endpoints/mineandGET /agent/erc8004/mine- The same wallet sends the real on-chain transaction via prepare/finalize routes
update_agent.pyusesupdate/prepareplusupdate/finalize, and automatically sends the on-chain URI update transaction when metadata changes
Technical Details
Base (EVM) Payments
Uses EIP-712TransferWithAuthorization signatures:
- Gasless for the payer
- Facilitator settles on-chain
- Simplest production default
Solana Payments
UsesVersionedTransaction with MessageV0:
- Facilitator pays gas fees
- SPL Token
TransferCheckedinstruction - Must include the live
feePayerfrom the challenge - Exact-payment payload must stay within facilitator compute limits
- The bundled signer handles the current live flow
Skill Metadata
| Field | Value |
|---|---|
| Slug | x402-layer |
| Version | 1.12.0 |
| Networks | Base, Ethereum, Polygon, BSC, Monad, Solana |
| Currency | USDC |
Resources
Changelog
v1.12.0
- Added API schema support for endpoint route documentation (
--schema-file,--schema-json,--clear-schema) - Schema displays on marketplace listings, 402 challenge responses, and hosted pay page API testers
- Agents can self-discover available routes from the 402 challenge or management API before paying
- Fixed worker skill version mismatch (was 1.10.6 in worker vs 1.11.1 in SKILL.md)
v1.10.3
- added optional OpenWallet / OWS support for pay, discover, and sign-message flows
- added a dedicated
ows_cli.pywrapper plus OpenWallet guidance - kept private-key and AWAL flows intact while expanding wallet backend options
v1.9.1
- hardened
xmtp_support.mjsby removing the environment-driven Studio base override from the helper itself - added explicit runbooks for World AgentKit benefits and XMTP support thread operations
- refreshed stale example versions and kept MCP guidance in the same install surface
v1.8.2
- removed globally-required secret env declarations from skill metadata
- documented capability-specific environment requirements so users expose only the vars needed for the current task
- synced the safer environment guidance across the hosted skill and public docs
v1.8.1
- fixed direct Base endpoint payments for skill usage by rejecting self-payment early
- aligned
pay_base.pywith the hosted purchase-path shape using?action=purchase
v1.8.0
- Added seller-side endpoint configuration parity for best-fit audience and verified human-backed AgentKit benefit fields
- Added real
manage_endpoint.py updatesupport against worker PATCH routes
v1.7.0
- Added wallet-signed support APIs for agent wallets
- Added support thread commands and XMTP helper flows for agent-side support operations
- Preserved AgentKit-aware discovery and optional Base payment flow for verified human-backed agent wallets
v1.5.0
- Added a first-class payments integration path for agents using direct endpoints, credits, products, webhooks, and receipt verification
- Added
payments-integration.mdas the decision guide for payment shape and fulfillment strategy - Fixed the bundled Solana signer to match the live PayAI-backed compute limit requirement
v1.4.0
- Wallet-first ERC-8004 / Solana-8004 registration is now the default for
register_agent.py - Added signed challenge + short-lived agent session flow for API-only wallet auth
- Added
list_my_endpoints.py,list_agents.py, andupdate_agent.pyfor full post-registration lifecycle management - Registration now supports version, tags, platform endpoint bindings, and custom endpoint URLs
- Removed the legacy x402-paid worker registration path; wallet-first registration is now the only supported agent flow
v1.0.1
- New Script:
consume_product.py- Purchase and download digital products
v1.0.0
Initial release with full x402 Agentic Access API integration: Provider Mode:- Deploy monetized endpoints with automatic wallet-to-wallet profit routing
- Top up credits programmatically
- List endpoints on public marketplace
- Marketplace discovery with filtering
- Pay-per-request with EIP-712 permits (Base) and VersionedTransaction (Solana)
- Credit-based access for zero-latency consumption
