X402engine
by @agentc22
Pay-per-call API gateway skill — calls 63 APIs (LLMs, image/video gen, flights, hotels, crypto, web search) via x402 micropayments. Each call costs $0.001-$0...
clawhub install x402engine📖 About This Skill
name: x402engine description: Pay-per-call API gateway skill — calls 63 APIs (LLMs, image/video gen, flights, hotels, crypto, web search) via x402 micropayments. Each call costs $0.001-$0.60 in USDC/USDm, enforced by a local policy engine with spend caps. version: 1.3.2 metadata: openclaw: requires: env: - EVM_PRIVATE_KEY bins: - node primaryEnv: EVM_PRIVATE_KEY emoji: "⚡" homepage: https://x402engine.app install: - kind: node package: "@x402/fetch" bins: [] - kind: node package: "@x402/evm" bins: [] - kind: node package: "viem" bins: []
x402engine
Call 63 paid APIs via x402 micropayments. Each API call costs between $0.001 and $0.60, paid with USDC on Base/Solana or USDm on MegaETH.
What this skill does
This skill signs and submits stablecoin micropayments to call remote APIs on the user's behalf. It uses the EVM_PRIVATE_KEY environment variable to sign on-chain payment transactions. Each call deducts a small amount from the wallet.
Cost transparency: When presenting results, include the cost of the call (e.g. "Bitcoin is $97,500 (cost: $0.001)"). If the user asks about spending, show full budget breakdown.
Triggers
How it works
1. Fetch cached service catalog from discovery endpoint (default: https://x402engine.app/.well-known/x402.json). 2. Score query against 63 service descriptions to find best match. 3. Run policy preflight — check per-tx caps, daily caps, and recipient allowlist before signing. 4. Call service via @x402/fetch — handles 402 payment flow automatically. 5. Return structured data to the agent for natural-language presentation.Rules
Security
Required credential
Optional configuration
These environment variables are NOT required. They provide additional controls:.x402engine-state.json.https://x402engine.app/.well-known/x402.json). Use a self-hosted catalog if you don't trust the default.false to skip policy preflight checks. Enabled by default.How payments work
All payments go to thepayTo address declared in the service catalog. The catalog is fetched from the discovery URL above. If you want to restrict which addresses can receive payments, configure a policy file with a recipient allowlist.Budget check
When the user asks "how much budget is left" or similar:Dependencies
This skill requires Node.js and the following npm packages (declared in package.json):@x402/fetch — x402 payment-aware fetch wrapper@x402/evm — EVM payment scheme (Permit2 signatures)viem — Ethereum client libraryInstall with: cd skills/x402engine && npm install
Reason Codes
POLICY_MISSING, POLICY_INVALIDCHAIN_DENIED, ASSET_DENIED, RECIPIENT_DENIEDPER_TX_EXCEEDED, DAILY_CAP_EXCEEDED, RATE_LIMITEDACTION_DENIEDSERVICE_NOT_FOUNDWALLET_UNDERFUNDED