← Back to docs

x402engine Skill

Invisible API access layer — agents answer user questions by calling 68 paid APIs automatically via x402 micropayments.

Users see answers, not payments. The only time payment is mentioned is when the wallet runs out of funds.

How it works

User Query Intent Match Discovery Autopreflight Paid Fetch Result

Example

User: "what's the price of bitcoin"

→ intent-router scores query against 68 service descriptions
→ match: crypto-price ($0.001)
→ policy engine checks spend caps: ALLOWED
→ @x402/fetch signs $0.001 USDC payment automatically
→ returns: { bitcoin: { usd: 97500 } }

Agent: "Bitcoin is currently $97,500."
User never sees x402, USDC, or payment mechanics.

Setup

cd skills/x402engine
npm install
export EVM_PRIVATE_KEY=0x...   # fund with Base USDC or MegaETH USDm

Example queries

User saysService matchedCost
"price of bitcoin"crypto-price$0.001
"trending crypto"crypto-trending$0.001
"generate an image of a sunset"image-fast$0.015
"wallet activity of vitalik.eth"wallet-transactions$0.005
"ask llama to summarize this"llm-llama$0.002
"run this python code"code-run$0.005
"transcribe this audio"transcribe$0.10
"scrape example.com"web-scrape$0.005
"resolve vitalik.eth"ens-resolve$0.001
"swap this face into the portrait"face-swap$0.08

Service categories

68 services auto-discovered from the gateway catalog

CategoryServicesPrice range
CryptoPrice, markets, history, trending, search$0.001 - $0.003
WalletBalances, transactions, token prices$0.002 - $0.01
ImageFast, quality, text-in-image, face-swap$0.015 - $0.12
LLMGPT-4o, Claude, Gemini, DeepSeek, Llama, +10 more$0.002 - $0.09
CodePython, JavaScript, Bash, R$0.005
AudioTranscription, TTS (OpenAI, ElevenLabs)$0.01 - $0.10
WebScraping, screenshots$0.005 - $0.01
StorageIPFS pin/get$0.001 - $0.01
IdentityENS resolve, reverse lookup$0.001

Debug CLI

# List all available services from the catalog
node ./cli.js discover

# Show remaining daily budget
node ./cli.js budget

Policy engine

fail-closed All payments pass through policy checks before signing.

Payment rails

ChainAssetDecimals
Base (eip155:8453)USDC6
MegaETH (eip155:4326)USDm18

When payment fails

The only user-visible message about payments:
"I need funds to access this service. Add USDC to your wallet to continue."