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.
Installation
pip install xenarch[agent,crewai]
Requires crewai>=0.80.0.
The SDK provides three CrewAI tool functions:
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
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.
Full example
See the CrewAI agent example for a complete working script.