> ## 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.

# Examples

> Working x402 code examples — Python agents, LangChain, CrewAI, MCP with Claude Desktop, FastAPI publishers. Copy-paste ready for USDC micropayments.

Complete, runnable examples for every integration pattern. Each example follows the same setup:

```bash theme={null}
cd <example-dir>
pip install -r requirements.txt
cp .env.example .env   # edit with your keys
python main.py
```

## For agents

<CardGroup cols={2}>
  <Card title="Python (raw SDK)" icon="python" href="/examples/python-agent">
    Minimal agent: check gate, pay USDC, fetch content. No framework.
  </Card>

  <Card title="LangChain" icon="link" href="/examples/langchain-agent">
    ReAct agent with autonomous payment decisions.
  </Card>

  <Card title="CrewAI" icon="users" href="/examples/crewai-agent">
    Multi-agent crew with specialized research agent.
  </Card>

  <Card title="MCP (Claude)" icon="message-bot" href="/examples/mcp-claude">
    Zero-code setup for Claude Desktop and Claude Code.
  </Card>
</CardGroup>

## For publishers

<CardGroup cols={1}>
  <Card title="FastAPI" icon="server" href="/examples/fastapi-publisher">
    Server-side gating with middleware and per-route decorator.
  </Card>
</CardGroup>

## Prerequisites

* Python 3.10+
* A funded wallet on Base (USDC + small ETH for gas)
* For testnet: use `base-sepolia` network with mock USDC

Source code: [github.com/xenarch-ai/xenarch-examples](https://github.com/xenarch-ai/xenarch-examples)
