Skip to content

Get gasless quote

GET /gasless/quote

Plan a gasless same-chain swap and return everything the wallet needs to sign. acquisitionMode is required and must be 2 (Permit2) or 3 (Permit2 witness, which binds the exact swap parameters into the signature). The response data is an array of quote objects, each carrying the underlying route, the gasless fee taken in the input token, a Permit2 nonce and deadline, and an eip712 payload to sign with the wallet's typed-data signing method. Submit the resulting signature to POST /gasless/submit-swap before the deadline.

Authentication

Send your API key in the api-key header.

Parameters

Name In Type Required Description
fromToken query string yes Input token contract address on the source chain.
toToken query string yes Output token contract address on the destination chain.
amount query string yes Input amount as a base-10 integer string in the input token's base units.
fromChain query integer yes Source chain id. Must equal toChain; gasless cross-chain swaps are not supported.
toChain query integer yes Destination chain id. Must equal fromChain.
sender query string yes Address that owns the input tokens and signs the permit.
acquisitionMode query integer (enum) yes Required. 2 = Permit2, 3 = Permit2 witness. Any other value is rejected with 400.
receiver query string no Recipient of the output tokens. Defaults to sender.
feeBps query integer no Integrator fee in basis points, taken from the input amount.
slippage query number no Slippage tolerance as a percentage (1.0 means 1%).
deadlineMinutes query integer no Minutes until the Permit2 signature deadline. Defaults to the deployment's configured value.
rankingMode query string no Route ranking mode. One of fastest, max_value, or suggested. Unknown values fall back to max_value.

Responses

Status Description
200 Signable gasless quotes (array with the best route first).
400 Invalid request — unsupported acquisitionMode, a cross-chain pair, or no route for the pair. Plausible catalog codes behind the numeric status include VALIDATION_001 (invalid input) and VALIDATION_002 (invalid address format).
401 Missing or invalid API key. Plausible catalog codes behind the numeric status are AUTH_001 (unauthorized access) and AUTH_002 (invalid API key).
500 Unexpected server-side failure. Plausible catalog codes behind the numeric status include SYSTEM_002 (internal server error) and SYSTEM_001 (database operation failed).
200 response
{
  "code": 0,
  "message": "success",
  "data": [
    {
      "quoteId": "8c6f1d0b8a9e4f2c5d3b7a1908e6c4f2d0b8a6e4c2f0d8b6a4e2c0f8d6b4a2e0",
      "quote": {
        "amount": "1000000000",
        "amountOut": "398400000000000000",
        "amountOutUsd": 998.74,
        "amountUsd": 1000.0,
        "expiry": 1785283500,
        "fees": {
          "integratorFee": "0",
          "integratorFeeUsd": 0.0,
          "routeFee": "0",
          "routeFeeUsd": 0.0
        },
        "fromToken": {
          "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "chain": 8453,
          "decimals": 6,
          "name": "USD Coin",
          "priceUsd": 1.0,
          "symbol": "USDC"
        },
        "gasFee": {
          "gasFee": "210000000000000",
          "gasFeeUsd": 0.53,
          "gasLimit": "210000",
          "gasToken": {
            "address": "0x0000000000000000000000000000000000000000",
            "chain": 8453,
            "decimals": 18,
            "name": "Ether",
            "priceUsd": 2510.4,
            "symbol": "ETH"
          },
          "gasPrice": "1000000000"
        },
        "minAmountOut": "396408000000000000",
        "minAmountOutUsd": 993.75,
        "path": [
          {
            "amount": "1000000000",
            "amountOut": "398400000000000000",
            "fromToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
            "provider": {
              "name": "AMM Pool",
              "type": "dex"
            },
            "toToken": "0x4200000000000000000000000000000000000006",
            "type": "swap"
          }
        ],
        "providers": [
          {
            "name": "AMM Pool",
            "type": "dex"
          }
        ],
        "quoteId": "8c6f1d0b8a9e4f2c5d3b7a1908e6c4f2d0b8a6e4c2f0d8b6a4e2c0f8d6b4a2e0",
        "receiver": "0x1a2B3c4D5e6F7a8B9c0D1e2F3a4B5c6D7e8F9a0B",
        "sender": "0x1a2B3c4D5e6F7a8B9c0D1e2F3a4B5c6D7e8F9a0B",
        "slippage": 0.5,
        "toToken": {
          "address": "0x4200000000000000000000000000000000000006",
          "chain": 8453,
          "decimals": 18,
          "name": "Wrapped Ether",
          "priceUsd": 2510.4,
          "symbol": "WETH"
        },
        "estimatedTimeMs": 4000,
        "routeKind": "sameChainSwap"
      },
      "eip712": {
        "types": {
          "EIP712Domain": [
            {
              "name": "name",
              "type": "string"
            },
            {
              "name": "chainId",
              "type": "uint256"
            },
            {
              "name": "verifyingContract",
              "type": "address"
            }
          ],
          "PermitTransferFrom": [
            {
              "name": "permitted",
              "type": "TokenPermissions"
            },
            {
              "name": "spender",
              "type": "address"
            },
            {
              "name": "nonce",
              "type": "uint256"
            },
            {
              "name": "deadline",
              "type": "uint256"
            }
          ],
          "TokenPermissions": [
            {
              "name": "token",
              "type": "address"
            },
            {
              "name": "amount",
              "type": "uint256"
            }
          ]
        },
        "domain": {
          "name": "Permit2",
          "chainId": 8453,
          "verifyingContract": "0x000000000022D473030F116dDEE9F6B43aC78BA3"
        },
        "primaryType": "PermitTransferFrom",
        "message": {
          "permitted": {
            "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
            "amount": "1000000000"
          },
          "spender": "0x7F3a9C1e5B2d8A4f6C0e3B7d9A1f4E6c8B0d2F35",
          "nonce": "1785283260123456789",
          "deadline": "1785284100"
        }
      },
      "fee": {
        "feeAmount": "1250000",
        "feeRecipient": "0x7f3a9c1e5b2d8a4f6c0e3b7d9a1f4e6c8b0d2f35",
        "feeUsd": 1.25
      },
      "nonce": "1785283260123456789",
      "deadline": "1785284100",
      "calldataTemplate": {
        "to": "0x7F3a9C1e5B2d8A4f6C0e3B7d9A1f4E6c8B0d2F35",
        "value": "0",
        "innerData": "0x000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000004200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000003b9aca00",
        "meta": "acquisitionMode=2"
      }
    }
  ]
}
400 response
{
  "code": 400,
  "data": null,
  "message": "acquisitionMode must be 2 (Permit2) or 3 (Permit2Witness)"
}
401 response
{
  "code": 401,
  "data": null,
  "message": "missing api-key header"
}
500 response
{
  "code": 500,
  "data": null,
  "message": "internal server error"
}