> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenarch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CrewAI

> CrewAI payment tools — let CrewAI crews pay for x402-gated content with USDC micropayments on Base. MCP-compatible drop-in tools.

## Installation

```bash theme={null}
pip install xenarch[agent,crewai]
```

Requires `crewai>=0.80.0`.

## Tools

The SDK provides three CrewAI tool functions:

```python theme={null}
from xenarch.tools.crewai import check_gate, pay, get_history
```

| Tool          | Description                                  |
| ------------- | -------------------------------------------- |
| `check_gate`  | Check if a URL has an x402 payment gate      |
| `pay`         | Execute USDC payment and return access token |
| `get_history` | View past payments for this wallet           |

## Usage

```python theme={null}
from dotenv import load_dotenv
from crewai import Agent, Crew, Task
from xenarch.tools.crewai import check_gate, pay, get_history

load_dotenv()

researcher = Agent(
    role="Research Agent",
    goal="Access gated web content by paying when needed",
    backstory=(
        "You are a research agent that pays for gated content using "
        "Xenarch micropayments when you encounter payment gates."
    ),
    tools=[check_gate, pay, get_history],
    verbose=True,
)

task = Task(
    description=(
        "Check if https://example.com has a payment gate. "
        "If it does, pay for access and report what you found."
    ),
    expected_output="Gate status and payment result.",
    agent=researcher,
)

crew = Crew(agents=[researcher], tasks=[task], verbose=True)
result = crew.kickoff()
print(result)
```

## Wallet configuration

Same as the core SDK — see [Agent Quickstart](/quickstart-agent).

## Full example

See the [CrewAI agent example](/examples/crewai-agent) for a complete working script.
