Skip to main content
HomeLanding pagesCrewAI payment integration
LANDING PAGE

CrewAI payment integration

8 min read·Last updated June 2, 2026

CrewAI is Python and the x402 client ships for Node, so each agent pays through a small local proxy built on createX402Client. Point one BaseTool at the proxy and the calling agent pays in USDC on Base. Map one wallet per CrewAI agent for clean per-role budgets and audit. Works with sequential and hierarchical processes, Flows, and sync or async tools.

What the integration covers

The CrewAI payment integration is a pattern, not a package. Each agent in a crew pays through a small local x402 proxy built on @blockchain0x/x402, which gives the crew four capabilities it lacks by default: per-agent paid-tool calls, per-agent identity with a public profile counterparties can verify, per-agent spend limits that survive prompt injection, and audit indexed by agent rather than by crew run.

The design principle is that every CrewAI agent is its own economic actor. A crew of five agents has five wallets, five limits, and five audit trails. That matches how CrewAI already thinks - each agent has its own role, goal, and tools - and extends the same isolation to money.

This is the integration-cluster reference. The task-oriented walkthrough is how-to-add-payments-to-crewai-agent, which includes the full proxy code; the canonical reference is the CrewAI integration page. Here the focus is what the integration is, what it touches, and the crew-specific patterns.

Compatibility matrix

Because each agent's tool calls a localhost proxy, anything in CrewAI that calls a tool works.

CrewAI surface Supported? Notes
BaseTool subclasses Yes _run calls the proxy; no Blockchain0x code in Python
Sync tools (_run) Yes Standard path
Async tools (_arun) Yes Use an async HTTP client to the proxy
Agent with one or many tools Yes Each tool calls a proxy; wallets are per agent
Process.sequential Yes The executing agent pays
Process.hierarchical Yes Manager and delegates pay from their own wallets
Crew.kickoff() / kickoff_async() Yes No special config
CrewAI Flow Yes Inside the Crews the Flow invokes
Custom llm per Agent Yes LLM-agnostic
Payment client language Node The x402 client is Node; the proxy bridges Python CrewAI to it

What is not in scope:

  • Tools that bypass BaseTool and call HTTP directly. Point them at the proxy yourself, or wire the payment API directly.
  • A single crew-wide pre-authorized budget across all agents at once. The model is per agent; share one key across proxies if you must, and accept the attribution trade-off.

Surface area in one screen

The Python side has no Blockchain0x code at all. A tool just calls the proxy:

PYTHON
from crewai.tools import BaseTool
import requests

class RealtimeQuoteTool(BaseTool):
    name: str = "get_quote_realtime"
    description: str = "Fetch a real-time quote for a stock ticker."

    def _run(self, ticker: str) -> str:
        upstream = f"https://quotes.example.com/v1/quote?ticker={ticker}"
        res = requests.post("http://127.0.0.1:8787", json={"url": upstream}, timeout=30)
        return res.text if res.status_code == 200 else f"Lookup failed: {res.status_code}"

The proxy is the Node piece, about thirty lines built on createClient plus createX402Client. The full proxy code is in the how-to-add-payments-to-crewai-agent walkthrough. Run one proxy per agent wallet, each on its own port with its own B0X_API_KEY.

The other half is the spend limit, which you set in the dashboard and read back over the API:

PYTHON
import os, requests

res = requests.get(
    f"https://api.blockchain0x.com/v1/agents/{os.environ['RESEARCHER_AGENT_ID']}/spend-permissions",
    headers={"Authorization": f"Bearer {os.environ['B0X_API_KEY']}"},
    timeout=30,
)
permissions = res.json()  # allowance_wei, per_tx_wei, period_seconds, ...

No new Agent class, no replacement Crew runtime, no patching of CrewAI internals. The integration is additive: a tool that calls a proxy, and a limit you set once.

Running one proxy per agent sounds heavy and is not. The proxy is stateless and tiny, so a five-agent crew runs five proxies on five ports under one process manager, or as five containers in the same pod. Pass each its own B0X_API_KEY and its own port through the environment, and have each agent's tool read the matching port from a config value. In practice teams template this: a short loop reads a map of agent name to key and port, starts a proxy for each, and the crew definition references the same map. It is the same shape as running one sidecar per service, which most teams already know how to operate.

Crew patterns and per-agent wallets

The integration earns its keep when you use it the way CrewAI already structures work: one wallet per agent. Four patterns follow.

Role-based budgets. A researcher hitting premium data needs a higher allowance than a summariser that only calls an LLM. Per-agent wallets let you set the limit per role. A shared wallet forces you to budget for the worst case and over-allocate everyone else.

Manager-with-delegates billing. In Process.hierarchical, the manager delegates to specialists. With per-agent wallets, the manager pays each delegate for its sub-task and the owner gets a per-delegate audit trail. This is the agent-to-agent pattern in miniature, documented at the agent-to-agent payment glossary entry.

Crews-of-crews. Flow-orchestrated multi-crew systems treat each Crew as a unit, and the per-agent wallets inside each Crew keep working. Audit at the Flow level shows which Crew spent; audit at the agent level shows which role within it spent.

Safety through isolation. A prompt-injected agent spends only its own allowance. The rest of the crew keeps running. Share one wallet and a single compromised agent can drain the balance for everyone on it.

For the parallel decisions on LangChain, see langchain-payment-integration.

What the integration does not touch

The pattern stays narrow. These parts of your CrewAI stack are untouched:

  • The LLM. Each agent's llm passes through; payment is in the tool.
  • Role, goal, backstory. Agent personality and reasoning are unchanged.
  • The Process type. Sequential, hierarchical, custom, all see normal tools.
  • Task delegation. allow_delegation=True keeps working; payment runs on the underlying tool calls.
  • Memory and context. Short-term, long-term, and entity memory operate independently.
  • Telemetry. OpenTelemetry and CrewAI's own observability see normal tool invocations.
  • Other tools. Free tools coexist with paid ones on the same agent.

When this is the right integration

Two situations where this pattern beats the alternatives.

Your crew calls paid third-party services. Premium data, paid LLMs, paid MCP tools, all surface as 402-returning endpoints the proxy handles. The alternative, per-tool credentials and per-tool rate limiters, does not scale past a handful of tools and gives you no unified limit.

Your crew is itself a paid service. Flip the direction and gate your crew's HTTP surface with the x402 server adapter so external callers pay it. Same protocol, other side of the call graph. The receive side is covered in how-to-add-payments-to-mcp-server.

Where it is not the right pick: a single-agent crew calling one trusted provider with a shared key (no payment surface to add), a fully internal crew where nothing is paid (no economic actor needed), or a workload where humans drive every payment through checkout (use Stripe).

Pricing and tier choices

The pattern is free; you write code against open packages. What you pay is the wallet platform fee, set per agent by tier on the pricing page: Free is $0 per agent per month at a 5% transaction fee, Pro is $9 per agent per month at 2%, and Business is $29 per agent per month at 1%. Per-agent pricing means you pay for the agents that actually transact.

A typical crew shape: keep agents on Free until their volume justifies an upgrade, then move the busiest to Pro. The rough crossover is a few hundred dollars of monthly volume per agent, where Pro's monthly fee plus 2% beats Free's flat 5%. Because tiers are per agent, you mix freely.

One CrewAI-specific note: in Process.hierarchical, the manager usually has the highest volume because every delegation routes through it. Upgrade that agent first and leave the specialists on Free until their own volume earns the change.

FAQ

Frequently asked questions.

Does it work with both Process.sequential and Process.hierarchical?

Yes. The payment lives in the tool, which is the same surface in both. In hierarchical, the manager and each delegate point at their own proxy, so they pay from their own wallets. In sequential, the agent currently executing pays for its own tool calls. Both shapes get per-agent attribution without extra work.

What about CrewAI Flows?

Flows are the graph-style layer above Crews. Payment works inside the Crews a Flow invokes: each Crew's agents have their own wallets via their proxies, and the Flow itself needs no wallet unless it makes paid calls directly. Most teams route with Flows and keep paid behavior inside the Crews.

Can a manager agent pay a delegate agent in the same crew?

Yes, and it is a clean pattern. The delegate exposes a paid endpoint gated by the x402 server adapter, and the manager pays it through its proxy like any other paid service. Internally it is an agent-to-agent payment; see the [agent-to-agent payment glossary entry](/learn/glossary/agent-to-agent-payment) for the broader shape.

Why a Node proxy instead of a Python package?

The x402 payment client ships for Node today, and CrewAI is Python. Rather than invent a Python package that does not exist, you run one small Node process that holds the wallet and answers 402s, and your CrewAI tools call it over localhost. It is about thirty lines and one process per agent wallet.

Does it work with custom Agent LLMs?

Yes. The payment is in the tool, not the model, so it is LLM-agnostic. CrewAI's `llm` parameter on Agent (OpenAI, Anthropic, Mistral, local) passes through unchanged. Swapping models does not touch the payment path.

What if I want one shared wallet for the whole crew?

Point every agent's proxy at the same key and they share the wallet. You lose per-agent isolation and per-role attribution and gain simpler reporting. The default we recommend is one wallet, and one proxy, per agent, so a single compromised agent cannot spend another's allowance.

Create your free agent wallet in 5 minutes.

First payment confirmed in under ten minutes. Free to start.