fee
Run before setting a priority fee. Gives the price in the exact unit Compute Budget expects (micro-lamports per compute unit) and the total cost in SOL, so a unit mix-up never overpays. Turns recent on-chain priority fees into three prices: cheap, normal and fast. Pass your transaction to get its compute limit and exact cost at each price. Inputs: tx (optional): Optional. Your transaction, so fees are measured on the accounts it writes to and compute is measured by a dry run. network (optional): Which Solana network to read. Default "mainnet-beta" (real money). Cost: 25 free calls a day, then $0.01 USDC per call (x402). Full field-by-field docs: GET /api/tools/fee.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tx | No | Optional. Your transaction, so fees are measured on the accounts it writes to and compute is measured by a dry run. From your wallet SDK before signing: Buffer.from(tx.serialize({ requireAllSignatures: false })).toString('base64'). Or the swap transaction an aggregator API gave you. | |
| network | No | Which Solana network to read. Default "mainnet-beta" (real money). Leave it out for mainnet. Use "devnet" only for test wallets. | mainnet-beta |