Paid endpoint. Pass your key in the
x-api-key header. See Get an API key.Why agents use this
- Zero-cost preview. Simulation is off-chain. You pay one gateway call, not a transaction fee, to know if the tx works.
- Real compute units.
unitsConsumedtells you exactly how much CU to request, avoiding both underruns and wasted headroom. - Full log stream. If simulation fails,
logscontains the exact error, program, and line that broke it. - Slippage preview. For swap transactions, simulation reveals what tokens actually move, so you can show the user a real outcome before they approve.
Use cases
- Preview slippage in a Discord bot. User asks the bot to swap. Bot builds the tx, simulates it, and posts “You’ll receive 12.4 BONK” instead of “unknown”. User approves, then the bot signs.
- CI test suite for Solana programs. Every PR runs a suite of simulated instructions against devnet and asserts on log output.
- Agent self-check before signing. Your autonomous bot built a swap. Simulate first; if
success: false, retry with different params instead of burning a fee. - Compute unit budget optimization. Loop: simulate, read
unitsConsumed, setcomputeUnitLimit = unitsConsumed * 1.1. Cheapest possible fee. - Failure debugging in support tickets. User sends you a failing signature. Simulate the same tx and read the logs, respond with the exact reason.
Recipe: safe preview + sign flow
preview-then-sign.ts