What the wallet tool is
A CrewAI wallet tool is a reusable BaseTool that gives an agent the ability to pay. The agent calls it with a target, and the tool, via a small local proxy, settles any 402 in USDC on Base and returns the result. The agent gets a wallet the way it gets any other capability in CrewAI: as a tool in its tools list, invoked when a task needs it.
There is no Blockchain0x CrewAI package. CrewAI is Python and the x402 client ships for Node, so the wallet tool is a Python BaseTool that calls a tiny Node proxy holding the wallet. This page is the focused artifact; for the broader integration overview see crewai-payment-integration, and for the task walkthrough see how-to-add-payments-to-crewai-agent. The payment API product page is the reference.
Why a Node proxy
The payment client that answers a 402 and settles in USDC, @blockchain0x/x402, is Node-only, and CrewAI is Python. Rather than invent a Python package that does not exist, the wallet tool calls a small Node proxy that does the real x402 work and holds the wallet. It is about thirty lines, one process per wallet, and it keeps every payment identifier on the verified Node surface. The proxy is the same one used across the Python-framework guides; the CrewAI part is just the BaseTool that calls it.
Build the tool
The tool is a BaseTool whose _run posts the target to the proxy.
from crewai.tools import BaseTool
import requests
class WalletTool(BaseTool):
name: str = "pay_and_fetch"
description: str = "Fetch a URL, paying in USDC if it requires payment. Returns the response body."
def _run(self, url: str) -> str:
res = requests.post("http://127.0.0.1:8787", json={"url": url}, timeout=30)
return res.text if res.status_code == 200 else f"Request failed: {res.status_code}"Start the proxy (node pay-proxy.mjs, the thirty-line service from the CrewAI walkthrough), add WalletTool() to an agent's tools, and the agent can pay. That is the wallet tool: one class plus a proxy, reusable across the crew.
One tool per agent wallet
The reusability shines in a multi-agent crew, where each agent should keep its own wallet. Run one proxy per agent on its own port with that agent's key, and bind each agent's tool to its proxy's port.
class WalletTool(BaseTool):
name: str = "pay_and_fetch"
description: str = "Fetch a URL, paying in USDC if required."
port: int = 8787
def _run(self, url: str) -> str:
res = requests.post(f"http://127.0.0.1:{self.port}", json={"url": url}, timeout=30)
return res.text if res.status_code == 200 else f"Failed: {res.status_code}"
researcher_tool = WalletTool(port=8787) # researcher's proxy/wallet
writer_tool = WalletTool(port=8788) # writer's proxy/walletTwo agents, two proxies, two wallets, the same tool class. The dashboard attributes spend per agent, and a compromised agent can only spend its own balance. Shared code, separate accounts.
Write the description for the planner
A CrewAI agent decides whether to use a tool from its description, so the wallet tool's description is doing real work and is worth getting right. Say plainly what it does and when to use it: that it fetches a URL and pays if the URL requires payment, and that it returns the response body. That is usually enough for the planner to reach for it when a task needs a paid resource and to leave it alone otherwise.
Decide deliberately whether to mention cost. If you want the planner to weigh price, note that calls may cost a small amount in USDC; if you would rather it not hesitate over routine sub-cent calls, leave cost out and let the wallet's spend limit be the control. Either is valid, but be intentional, because a vague description ("interact with the wallet") leaves the planner guessing about when the tool applies, while a precise one ("fetch a URL, paying in USDC if required") tells it exactly. The tool code is small; the description is where you actually shape the agent's behavior around it.
Operating the proxies
Running one proxy per agent sounds heavy and is not, but it is worth a word on operating them. Each proxy is a stateless thirty-line Node process, so you run them the way you run any small sidecar: as separate processes under a process manager, or as separate containers in the same pod, one per agent wallet. Pass each its own B0X_API_KEY and port through the environment, and template the mapping of agent to key-and-port so the crew definition and the proxies reference the same source.
Bind every proxy to 127.0.0.1, never a public interface, because it holds a wallet key and pays whatever URL it is handed; treat it like the credential it is. In practice a five-agent crew is five small local processes, which any team already running sidecars operates without trouble. When a Python x402 client eventually ships, this collapses to an in-process call, but until then the per-agent proxy is the honest, working pattern, and it scales linearly with the number of paying agents rather than adding any shared bottleneck.
Compatibility
Because the wallet tool is an ordinary BaseTool, it works across CrewAI's surfaces.
| CrewAI surface | Works? | Notes |
|---|---|---|
BaseTool on an Agent |
Yes | Add the tool to the agent's tools list |
Process.sequential |
Yes | The executing agent's tool pays from its wallet |
Process.hierarchical |
Yes | Manager and delegates each have their own proxy and tool |
Crew.kickoff() / kickoff_async() |
Yes | No special config |
CrewAI Flow |
Yes | Inside the Crews the Flow invokes |
| Payment client language | Node | The proxy bridges Python CrewAI to the Node x402 client |
When to use it
Reach for the wallet tool when agents in a crew need to pay for what they call and you want that capability as one reusable unit rather than per-tool glue. It fits when several agents share the same paying behavior, since you build the tool once and bind it per agent, and when payment should be a capability the crew can use deliberately.
It is the wrong shape when only one specific tool should ever pay (wrap that tool's own call through the proxy instead) or when the crew is fully internal with no paid calls. Match it to whether paying is a general capability the agents need or a one-off behavior of a single tool.
Pricing
The tool is free; you build it from open packages. What you pay is the wallet platform fee per agent on the pricing page: Free is $0 per agent per month at a 5% transaction fee, Pro is $9 at 2%, and Business is $29 at 1%. Per-agent pricing means each agent that transacts through its tool is billed on its own wallet, so a crew where only two agents pay only incurs fees for those two.
What to ship today
Start a proxy with a sk_test_ key, write the WalletTool BaseTool that calls it, and add it to a CrewAI agent, then make one paid call on Base Sepolia. For a multi-agent crew, run a proxy per agent and bind each tool to its port. For the broader integration overview see crewai-payment-integration. Pricing is on the pricing page.