Skip to main content
XenarchCrewaiPay is a CrewAI BaseTool named xenarch_pay. Given a URL, it fetches it, pays any HTTP 402 challenge in USDC on Base, and returns the result as a JSON string.

Installation

Requires Python 3.12 or later. The extra installs crewai 1.0 or later and the x402 payment stack.

Create the tool

It takes the same arguments as the LangChain tool: private_key, budget_policy, discover_via_pay_json, http_timeout and max_response_bytes. The wallet needs USDC on Base and no ETH.
Do not set XENARCH_API_TOKEN in the process that runs this tool. In xenarch 1.1.0 the tool sends its platform cap check to https://xenarch.dev, which does not serve the API, so every payment would be refused. budget_policy is the spending limit.

Use it in a crew

CrewAI reads the model from its own configuration, for example OPENAI_API_KEY in the environment. On success the tool’s JSON has "success": true, amount_usd, body and, for Xenarch gates, tx_hash and gate_id. A refusal returns an error key, such as budget_exceeded.

Full example

See the CrewAI agent example.