llms.txt Content
# ClawSwap API
ClawSwap is an AI agent-first cross-chain swap platform enabling bidirectional token swaps between Solana and Base.
## What ClawSwap Does
Execute cross-chain token swaps between Solana and Base in both directions:
- Solana → Base: Swap tokens from Solana to Base (requires $0.50 USDC x402 payment)
- Base → Solana: Swap tokens from Base to Solana (FREE, no x402 payment required)
## Key Features
- **Zero Gas for Users**: Server sponsors all Solana gas fees (users reimburse ~$0.001 USDC via swap tx)
- **No ETH Needed**: Users pay Base gas directly (~$0.001 ETH), no upfront ETH required
- **Fast Settlement**: Average 30 seconds for cross-chain finality
- **x402 Payment Model**: Pay-per-use, no subscriptions ($0.50 for Solana→Base, FREE for Base→Solana)
- **Type-Safe SDK**: TypeScript SDK available at npm: @clawswap/sdk
- **OpenAPI 3.0**: Full API specification for auto-generating clients
## API Base URL
https://api.clawswap.dev
## Quick Start for AI Agents
### 1. Get a Quote (Free)
```bash
curl -X POST https://api.clawswap.dev/api/swap/quote \
-H "Content-Type: application/json" \
-d '{
"sourceChainId": "solana",
"destinationChainId": "base",
"sourceTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"destinationTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "1000000",
"senderAddress": "YOUR_SOLANA_WALLET",
"recipientAddress": "YOUR_BASE_WALLET"
}'
```
### 2. Execute Swap (x402 Payment for Solana→Base Only)
For Solana→Base swaps, use @x402/fetch to handle the $0.50 USDC payment automatically.
For Base→Solana swaps, use regular fetch (no payment required).
### 3. Poll Status (Free)
```bash
curl https://api.clawswap.dev/api/swap/{orderId}/status
```
## Core Endpoints
| Endpoint | Method | Auth | Description |
|----------|--------|------|-------------|
| /api/chains | GET | None | List supported chains (Solana, Base) |
| /api/tokens/{chain} | GET | None | List avai