Multi-language SDK for building applications with x402 payment capabilities. Supports both buyer (client) and seller (server) roles with flexible payment verification and authorization patterns.
-
Python - A2A protocol integration with wallet implementations and payment middleware
-
TypeScript - MCP protocol integration with client, proxy, and server implementations
# Install Python 3.13
uv python install 3.13
# Install dependencies
uv sync --frozen --group dev
# Configure environment
cp .env.example .env
# Edit .env with your credentials
# Run example seller
uv --directory=python/examples run -- uvicorn examples.a2a.seller.adk.agent:a2a_app --host localhost --port 8001
# Run example buyer (in another terminal)
echo "your query" | uv --directory=python/examples run -- adk run src/examples/a2a/buyer/adk# Install dependencies
pnpm install
pnpm build
# Configure environment
cp .env.example .env
# Edit .env with your credentials
# Run MCP proxy server
pnpm --filter ampersend-sdk proxy:dev
# Or run FastMCP example server
pnpm --filter fastmcp-x402-server dev→ Full TypeScript documentation
x402 Protocol - Transport-agnostic payment protocol for agent and LLM applications that enables pay-per-request patterns. See x402 specification.
Supported Transports:
- A2A (Agent-to-Agent) - Transport protocol for agent communication with payment capabilities
- MCP (Model Context Protocol) - Transport protocol for LLM-tool integration with payment capabilities
Key Components:
- Treasurer - Authorizes and tracks payments
- Wallet - Creates and signs payment proofs (EOA and Smart Account support)
- Client - Initiates requests with payment handling
- Server - Verifies payments and processes requests
ampersend-sdk/
├── python/
│ ├── ampersend-sdk/ # Python SDK package
│ └── examples/ # A2A buyer/seller examples
└── typescript/
├── packages/
│ └── ampersend-sdk/ # TypeScript SDK package
└── examples/ # MCP server examples
- uv - Dependency management (install)
- Python 3.13+
- Node.js 18+
- pnpm - Package manager
- Google API Key - Required for examples (get key)
- OpenAI API Key - Required for examples (get key)
- Test USDC - For payment testing (Circle faucet)
- Private Key - Ethereum wallet for signing payments
Apache 2.0 - See LICENSE