← Back to docs

x402engine Skill

Invisible API access layer — agents answer user questions by calling 70+ 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 the current service catalog
→ 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-llamaRequest quote
"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
"create a video of a cat"video-fast$0.55

Service categories

125 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
ImageImage generation and editing, including GPT Image 2.5See live catalog
VideoVideo generation, including Seedance 2.5 and MiniMax H3See live catalog
LLM87 chat model routes with model-specific capabilitiesRequest quote
CodePython, JavaScript, Bash, R$0.005
AudioTranscription, TTS (OpenRouter, ElevenLabs)$0.02 - $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."