Skip to main content Home Creators demerzels-lab elsamultiskillagent x402-layer
x402-layer x402 Singularity Layer - Enable AI agents to deploy monetized API endpoints,
consume paid services via USDC payments, manage credits, and participate
in a self-sustaining agent economy. Supports Base and Solana networks.
Jump to install Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/Demerzels-lab/elsamultiskillagent --skill x402-layerThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... More from this repository Related occupations SOC
Based on SOC occupation classification
name x402-layer version 1.0.1 description x402 Singularity Layer - Enable AI agents to deploy monetized API endpoints,
consume paid services via USDC payments, manage credits, and participate
in a self-sustaining agent economy. Supports Base and Solana networks.
metadata {"clawdbot":{"emoji":"⚡","os":["linux","darwin"]}} allowed-tools ["Read","Write","Edit","Bash","WebFetch"]
x402 Singularity Layer
x402 is a Web3 payment layer enabling AI agents to:
💰 Pay for API access using USDC
🚀 Deploy monetized endpoints
🔍 Discover services via marketplace
📊 Manage endpoints and credits
Networks: Base (EVM) • Solana
Currency: USDC
Protocol: HTTP 402 Payment Required
Quick Start
1. Install Dependencies
pip install -r {baseDir}/requirements.txt
2. Set Up Wallet
PRIVATE_KEY=
WALLET_ADDRESS=
SOLANA_SECRET_KEY=
export
"0x..."
export
"0x..."
export
"[1,2,3,...]"
Scripts Overview
🛒 CONSUMER MODE (Buying Services) Script Purpose pay_base.pyPay for endpoint on Base network pay_solana.pyPay for endpoint on Solana network consume_credits.pyUse pre-purchased credits (fast) consume_product.pyPurchase digital products (files) check_credits.pyCheck your credit balance recharge_credits.pyBuy credit packs for an endpoint discover_marketplace.pyBrowse available services
🏭 PROVIDER MODE (Selling Services) Script Purpose create_endpoint.pyDeploy new monetized endpoint ($5) manage_endpoint.pyView/update your endpoints topup_endpoint.pyAdd credits to YOUR endpoint list_on_marketplace.pyPublish endpoint publicly
Consumer Flows
A. Pay-Per-Request (Recommended)
python {baseDir}/scripts/pay_base.py https://api.x402layer.cc/e/weather-data
python {baseDir}/scripts/pay_solana.py https://api.x402layer.cc/e/weather-data
B. Credit-Based Access (Fastest) Pre-purchase credits for instant access without blockchain latency:
python {baseDir}/scripts/check_credits.py weather-data
python {baseDir}/scripts/recharge_credits.py weather-data pack_100
python {baseDir}/scripts/consume_credits.py https://api.x402layer.cc/e/weather-data
C. Discover Services
python {baseDir}/scripts/discover_marketplace.py
python {baseDir}/scripts/discover_marketplace.py search weather
Provider Flows
A. Create Endpoint ($5 one-time) Deploy your own monetized API:
python {baseDir}/scripts/create_endpoint.py my-api "My AI Service" https://api.example.com 0.01
Includes 20,000 test credits.
B. Manage Your Endpoint
python {baseDir}/scripts/manage_endpoint.py list
python {baseDir}/scripts/manage_endpoint.py stats my-api
python {baseDir}/scripts/manage_endpoint.py update my-api --price 0.02
C. Top Up YOUR Endpoint (Provider) Add credits to maintain your endpoint's balance:
python {baseDir}/scripts/topup_endpoint.py my-api 10
Note: This is different from recharge_credits.py which is for CONSUMERS.
D. List on Marketplace Make your endpoint publicly discoverable:
python {baseDir}/scripts/list_on_marketplace.py my-api --category ai --description "AI-powered analysis"
Payment Technical Details
Base (EVM) - EIP-712 Signatures Uses USDC TransferWithAuthorization (EIP-3009):
Gasless for payer
Facilitator settles on-chain
100% reliable
Solana - Versioned Transactions Uses VersionedTransaction with MessageV0:
Facilitator pays gas (from extra.feePayer)
SPL Token TransferChecked instruction
~75% success rate (retry logic included)
Environment Reference Variable Required For Description PRIVATE_KEYBase payments EVM private key (0x...) WALLET_ADDRESSAll operations Your wallet address SOLANA_SECRET_KEYSolana payments JSON array of bytes
API Base URL
Endpoints: https://api.x402layer.cc/e/{slug}
Marketplace: https://api.x402layer.cc/api/marketplace
Credits: https://api.x402layer.cc/api/credits/*
Agent API: https://api.x402layer.cc/agent/*
Resources
Known Issues ⚠️ Solana payments have ~75% success rate due to facilitator-side fee payer infrastructure issue. Retry logic is included in pay_solana.py. Base (EVM) payments are 100% reliable and recommended for production.