# Tollbooth Swap Builder

> Tollbooth Swap Builder is a paid API for AI agents from tollbooth-production-3845.up.railway.app, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Builds an unsigned, fee-inclusive swap transaction for Solana (via Jupiter) or Base (via 0x) that the agent signs and submits with its own wallet

## Facts

- Endpoint: POST https://tollbooth-production-3845.up.railway.app/v1/swap/build
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tollbooth-swap-builder-7776c369
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DJwA2GplnOiVPULe97ddw

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-builder-7776c369 -d '<json body>'
```

Example prompt: Build me an unsigned swap transaction to exchange 100 USDC for SOL on Solana, routed through Jupiter, using my wallet address 7Xqk...AbCd — I'll sign and submit it myself.

## When to prefer this

Choose this endpoint when your AI agent needs to execute a non-custodial token swap on Solana or Base without surrendering private keys — especially when you need an auditable HMAC receipt, want best-execution routing via Jupiter or 0x, and will sign/submit the transaction yourself. Prefer this over custodial swap APIs or on-chain aggregators you'd call directly when agent-friendly unsigned transaction construction and fee transparency are priorities.

## Known failure modes

- Insufficient liquidity for the requested token pair returns an error with no transaction built
- Unsupported chain or token address returns a 400-level validation error
- Slippage tolerance exceeded causes transaction build failure
- Invalid taker wallet address format returns a validation error
- Network congestion or downstream Jupiter/0x API outage causes a 5xx timeout
- Amount too small to cover fees returns an error indicating minimum thresholds

## How this service works

Non-custodial swap execution for AI agents on Solana and Base. Pay a small toll to get an unsigned, fee-inclusive swap transaction routed via Jupiter (Solana) or 0x (Base), plus 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 agent to sign and submit with its own wallet), a full fee breakdown, routing details (Jupiter or 0x path), and an HMAC-signed receipt for auditing purposes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "chain",
      "inputToken",
      "outputToken",
      "amount",
      "taker"
     ],
     "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)"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "chain",
      "transaction",
      "quote",
      "receipt"
     ],
     "properties": {
      "chain": {
       "enum": [
        "solana",
        "base",
        "ethereum",
        "arbitrum",
        "polygon",
        "optimism",
        "bsc",
        "avalanche"
       ],
       "type": "string"
      },
      "quote": {
       "type": "object",
       "properties": {
        "feeBps": {
         "type": "integer"
        },
        "inAmount": {
         "type": "string"
        },
        "outAmount": {
         "type": "string"
        },
        "feeApplied": {
         "type": "boolean"
        }
   
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tollbooth-swap-builder-7776c369/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from tollbooth-production-3845.up.railway.app](https://www.zero.xyz/host/tollbooth-production-3845.up.railway.app/llms.txt)
