Drop-in files that give your agent framework pay-per-call superpowers on the Mekong Trade Intel fleet. Each Python plugin handles the full flow itself: unpaid request → HTTP 402 → parse PAYMENT-REQUIRED → EIP-712 sign a USDC/Base payment → retry with X-PAYMENT. No facilitator account, no API key.
PAYMENT-REQUIRED and X-PAYMENT are base64 STANDARD (fleet fix 2026-10-20). Only JWT signing uses base64url. All files below implement this correctly.Tool subclasses with paid 402 handling: generic X402PaidTool plus prebuilt web-search and token-price tools. Trial mode works with no wallet.
BaseTool subclasses: generic X402PaidBaseTool plus prebuilt web-search and news tools. Drop into any Crew.
make_x402_tool(...) factory returning StructuredTool for any endpoint, plus prebuilt web-search and news tools.
Skeleton Action with the integration steps documented inline — intentionally not wired, so no half-built wallet signer ships. Generate the full TS flow instead:
pip install requests eth_account + pip install smolagents / crewai / langchain-core as needed.export X402_PRIVATE_KEY=0x... (Base wallet with a little USDC) and export X402_MAX_USD_PER_CALL=0.05 to cap spend per call. On 402 the plugin signs and retries automatically.from smolagents import CodeAgent, InferenceClientModel
from smolagents_x402 import X402WebSearchPaid
agent = CodeAgent(tools=[X402WebSearchPaid()], model=InferenceClientModel())
agent.run("Latest news about Ethereum ETFs")