Skip to main content
HomeLanding pagesCrewAI payment integration
LANDING PAGE

CrewAI payment integration

8 min read·Last updated May 15, 2026

The Blockchain0x CrewAI integration decorates any BaseTool's _run with x402 settlement so the calling agent pays in USDC on Base. Each CrewAI Agent maps to its own Blockchain0x wallet, so per-agent budgets and audit attribution work cleanly across the crew. Compatible with sequential and hierarchical processes, Flows, and both sync and async tools.

What the integration covers

The Blockchain0x CrewAI integration is the official bridge between Blockchain0x agent wallets and CrewAI's Agent / Tool primitives. It adds four capabilities to a crew that it does not have by default: per-agent paid-tool calls, per-agent identity (with a public profile counterparties can verify), per-agent spend policies that survive prompt injection, and audit logs indexed by Agent rather than by Crew run.

The integration's design principle is that every CrewAI Agent is its own economic actor. A crew of five agents has five wallets, five spend policies, and five audit trails. This matches how CrewAI already thinks about Agents - each has its own role, goal, and tools - and extends the same isolation to money.

This LP is the integration-cluster reference. The task-oriented walkthrough is at how-to-add-payments-to-crewai-agent; the canonical reference page is /integrations/crewai. This page focuses on what the integration is, what surfaces it touches, and how to think about crew-specific patterns.

Compatibility matrix

What works today:

CrewAI surface Supported? Notes
BaseTool subclasses Yes Direct decoration of _run and _arun
Sync tools (_run) Yes Standard path; receipt argument injected before run
Async tools (_arun) Yes Same decorator, async path
Agent with single tool Yes Wrap the tool's BaseTool subclass
Agent with multiple tools Yes Wrap each tool independently; the wrapper is per-tool
Process.sequential Yes Agent currently executing pays
Process.hierarchical Yes Manager and delegates pay from their own wallets
Crew.kickoff() Yes No special config
Crew.kickoff_async() Yes Async path supported throughout
CrewAI Flow Yes Inside the Crews that the Flow invokes
Custom llm per Agent Yes LLM-agnostic
CrewAI 0.80.x / 0.85.x+ Yes Tracked against latest two majors

What is not yet supported:

  • Tools that bypass the BaseTool interface and call HTTP directly - wrap them with the underlying payment API instead.
  • Crew-wide wallets that pre-authorise a budget across all agents at once - the integration is per-agent by design; share via env-var if needed but accept the attribution trade-off.

Surface area in one screen

The package exports one decorator. The full integration on a single Agent's single Tool is roughly this:

PYTHON
from crewai.tools import BaseTool
from blockchain0x_crewai import require_payment
import os, json

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

    @require_payment(
        agent_id=os.environ["RESEARCHER_AGENT_ID"],
        api_key=os.environ["BLOCKCHAIN0X_API_KEY"],
        price_usdc="0.005",
        reason="Real-time quote",
    )
    def _run(self, ticker: str, receipt=None) -> str:
        return json.dumps(fetch_live_quote(ticker))

That is the whole surface for one paid tool on one agent. Each CrewAI Agent in your crew gets its own env-var-driven agent_id, its own spend policy (set once via the SDK), and reuses the same BLOCKCHAIN0X_API_KEY.

The spend-policy configuration runs once at provisioning time:

PYTHON
from blockchain0x import Client

client = Client(api_key=os.environ["BLOCKCHAIN0X_ADMIN_KEY"])

client.agents.update_spend_policy(
    os.environ["RESEARCHER_AGENT_ID"],
    daily_cap_usdc="20.00",
    per_payment_cap_usdc="0.50",
)

No new Agent class, no replacement Crew runtime, no monkey-patching of CrewAI internals. The integration is purely additive on the Tool layer.

Crew patterns and per-agent wallets

The integration is most useful when used the way CrewAI already structures work: one wallet per Agent. This unlocks four crew-specific patterns.

Specialist crews with role-based budgets. A researcher agent that calls premium data APIs needs a higher daily cap than a summariser agent that just calls an LLM. Per-agent wallets let you tune the budget 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 agent delegates work to specialists. With per-agent wallets, the manager pays each delegate for the sub-task; the workspace owner gets a clean per-delegate audit trail. This is the agent-to-agent payment pattern in miniature - documented separately at the agent-to-agent payment glossary entry.

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

Crew-level safety with per-agent isolation. A prompt-injected agent burns only its own daily cap. The rest of the crew keeps working. Without per-agent wallets, a single compromised agent can drain the workspace balance for every other agent that shares the wallet.

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

What the integration does not touch

The integration stays narrow. These pieces of your CrewAI stack are not affected:

  • The LLM. Each Agent's llm parameter passes through; the wrapper is on Tool, not LLM.
  • The role / goal / backstory. Agent personality and reasoning are unchanged.
  • The Process type. Sequential, hierarchical, custom - all see wrapped Tools as normal Tools.
  • Task delegation. CrewAI's allow_delegation=True continues to work; the wrapper just runs on the underlying tool calls.
  • Memory and context. CrewAI's short-term, long-term, and entity memory operate unchanged.
  • Telemetry. OpenTelemetry, LangSmith integration, and CrewAI's own observability hooks all see normal Tool invocations.
  • Other tools. Free tools coexist with wrapped paid tools on the same Agent.

When this is the right integration

Two scenarios where the CrewAI integration is the right pick over alternatives.

Your crew calls paid third-party services. Premium data, paid LLMs, paid MCP tools, paid APIs - all of these surface as 402-returning endpoints that the wrapper handles automatically. The alternative (per-tool credentials, per-tool rate limiters, per-tool logging) does not scale beyond a handful of tools.

Your crew is itself a paid service. You flip the direction and have your CrewAI Agent's Tools return 402 to external callers. Same decorator, different position in the call graph. This is the monetization side of the integration, covered in detail at /integrations/crewai.

Alternatives the integration is not the right pick over: a single-Agent crew that calls one trusted LLM provider with a shared API key (no payment surface to wrap); a fully internal crew where no calls are paid (no economic actor needed); a workload where humans drive every payment via traditional checkout (use a Stripe integration instead).

Pricing and tier choices

The integration is free. The wallet API tier per Agent (Free, Pro, Business) determines transaction-fee rates and feature unlocks - see /pricing/ for the breakdown. The Free tier supports per-agent wallets and basic spend policy and is enough for most early-stage crews. Pro is the tier most production crews settle on once volume picks up - it unlocks the more sophisticated spend policy (counterparty allowlists, time windows), the verification badges that build counterparty trust, and a lower 2% transaction fee. Business is the right pick when audit-log compliance and advanced spend-policy controls matter for procurement.

A typical crew shape: every Agent on Pro once revenue exceeds about $400/month per agent. Below that volume, Free's 5% fee is cheaper than Pro's monthly fee plus 2%. The math is identical to the LangChain integration's tier crossover documented in langchain-payment-integration; CrewAI does not change the economics.

One CrewAI-specific note: in Process.hierarchical, the manager agent typically has higher transaction volume than the specialists because every delegation routes through it. That is the agent to upgrade to Pro first; the specialists can stay on Free until their own volume justifies the upgrade. Tier choices in a crew are per-agent, not per-crew, so you can mix as your traffic shapes settle.

FAQ

Frequently asked questions.

Does the integration work with both Process.sequential and Process.hierarchical?

Yes. The wrapper sits on the Tool boundary, which is the same surface in both process types. In hierarchical, the manager agent and each delegate keep their own wallets and pay independently. In sequential, the agent currently executing pays for its own tool calls. Both shapes get per-agent attribution for free.

What about CrewAI Flows?

Flows are CrewAI's graph-style orchestration layer above Crews. The integration works inside the Crews that the Flow invokes - each Crew's agents have their own wallets, and the Flow itself does not need a wallet unless it makes direct paid calls outside a Crew. Most teams use Flows for routing and put paid behavior inside the Crews.

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

Yes, and this is one of the most useful patterns. The manager agent's wallet pays the delegate's wallet for the sub-task; both wallets are Blockchain0x agents with their own spend policies. 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 pattern. The integration handles this exactly the way it handles external paid tools.

How does the integration interact with CrewAI's task delegation?

Task delegation is a CrewAI mechanism, not a payment mechanism. The delegating agent calls a tool that internally invokes the delegate agent's logic; if that tool is wrapped with require_payment, the delegating agent pays. If you want both delegation tracking and payment attribution, use the integration's wrapper on the delegation tool itself.

Does the integration work with custom CrewAI Agent backends (other than the default LLM provider)?

Yes. The integration is LLM-agnostic - the agent's chosen LLM (OpenAI, Anthropic, Mistral, local) does not affect the Tool wrapper. CrewAI's `llm` parameter on Agent passes through unchanged.

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

Supported but not recommended for most cases. Set the same agent_id env var in every tool's wrapper and they will share the wallet. You lose per-agent isolation and per-role attribution; you gain simpler reporting if all crew members do similar work. The default we recommend is one wallet per CrewAI Agent.

Create your free agent wallet in 5 minutes.

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