x402 (machine-payable)

EVM swap price preview, paid per call via x402

Expected and minimum output for a pair/amount before committing to a firm quote. Query params: chainId, sellToken, buyToken ('native' or a 0x 40-hex address), sellAmount (integer, base units). A pair with no route answers an uncharged 404 rather than a paid empty estimate.

get/v1/x402/swap/evm/price

Request

  • Base URL: https://hostdefi.com/api
  • URL: https://hostdefi.com/api/v1/x402/swap/evm/price
  • Auth: none required

Response

Estimate: buyAmount, minBuyAmount, nativeUsd. Settlement receipt in the X-PAYMENT-RESPONSE header.

object required

Changes

No recorded changes to this operation across all 1 revision of this API.