# Tollbooth Swap Build

> Tollbooth Swap Build is a paid API for AI agents from api.tollboothswap.xyz, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-11, last successful call 2026-08-06).

Builds an unsigned, fee-inclusive swap transaction on Solana (via Jupiter) or Base (via 0x) for a given wallet to sign and submit, plus returns an HMAC-signed receipt for auditing.

## Facts

- Endpoint: POST https://api.tollboothswap.xyz/v1/swap/build?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Last successful call: 2026-08-06
- Success rate: 100% of calls made through Zero
- Rating: 2.0 / 5 from 1 review
- Activations on Zero: 5
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tollbooth-swap-build-12492393
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Z5R0uZzKCgQmc5g9vf62x

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability tollbooth-swap-build-12492393 -d '<json body>'
```

Example prompt: Build me a non-custodial swap transaction on Solana to sell 1000000 USDC (mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v) for SOL using my wallet 7xKX...abc with a max slippage of 50 basis points — I'll sign and send it myself.

## When to prefer this

Choose Tollbooth when you need a non-custodial swap transaction that you sign yourself — especially useful for AI agents that control their own wallets and need auditable HMAC-signed receipts. Prefer this over custodial swap services when key security is paramount, or when you want optimal routing (Jupiter on Solana, 0x on Base) without managing DEX integrations directly. Use the free GET /v1/quote endpoint first to comparison-shop, then call this to build the final transaction.

## Known failure modes

- Invalid or unsupported token address for the specified chain — returns error indicating unrecognized token
- Insufficient liquidity for the requested swap size — route not found
- Taker wallet address is malformed or mismatched with chain format
- Amount is zero or below minimum — rejected before routing
- Slippage tolerance too tight — no route fits within bounds
- Payment of $0.005 USDC toll not received — request rejected with 402
- Chain enum value not recognized (must be 'solana' or 'base')

## How this service works

Non-custodial swap execution for AI agents on 8 chains: Solana (Jupiter) plus Base, Ethereum, Arbitrum, Polygon, Optimism, BSC and Avalanche (0x). Pay a small toll to get an unsigned, fee-inclusive swap transaction and an HMAC-signed receipt for auditing. Comparison-shop first with free indicative quotes at GET /v1/quote (same parameters, no taker required). You sign and submit with your own wallet - Tollbooth never touches keys or funds.

## Output

Returns an unsigned swap transaction payload ready for the taker to sign and submit, routed optimally via Jupiter (Solana) or 0x (Base), with all fees included in the transaction. Also returns an HMAC-signed receipt containing swap metadata for auditing purposes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chain": {
   "enum": [
    "solana",
    "base",
    "ethereum",
    "arbitrum",
    "polygon",
    "optimism",
    "bsc",
    "avalanche"
   ],
   "type": "string",
   "description": "Chain to swap on"
  },
  "taker": {
   "type": "string",
   "description": "Wallet address that will sign and send the swap"
  },
  "amount": {
   "type": "string",
   "description": "Sell amount as an integer string in the input token's base units"
  },
  "inputToken": {
   "type": "string",
   "description": "Token being sold: mint address (solana) or ERC-20 address (EVM chains)"
  },
  "outputToken": {
   "type": "string",
   "description": "Token being bought: mint address (solana) or ERC-20 address (EVM chains)"
  },
  "slippageBps": {
   "type": "integer",
   "description": "Max slippage in basis points (default 100)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tollbooth-swap-build-12492393/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.tollboothswap.xyz](https://www.zero.xyz/host/api.tollboothswap.xyz/llms.txt)
