Skip to main content

Preflight (Dry Run)

Preflight answers “what would actually happen if I called this paid endpoint right now?” It runs the same wallet selection, caps, and fundability checks as a real call, but performs no on-chain transfer, no upstream call, and no settlement. Use it before high-cost or batched calls so an agent can make a budget decision without probing with real money.

Two ways to preflight

Add the dry-run header to any paid route:
Or call the dedicated route with the same auth headers:
Both return the same verdict. The response is marked with X-Apiosk-Dry-Run: true and is never cached.

The verdict

FieldMeaning
would_succeedWhether a real call would settle right now
reason_if_notHuman-readable reason when would_succeed is false
railx402, sepa, credits, free, or unauthorized
price_listed_usdcAuthorized gross price for the operation
wallet_to_useThe wallet the gateway would select (x402 rail)
spent_afterProjected daily spend and caps after this call, per rail
wallet_selection_strategyHow the gateway picks a wallet
Preflight models the x402 and SEPA rails; a real call may still settle over credits when preflight reports x402/sepa. Pin a rail with X-Apiosk-Rail (x402 or sepa) to test one path in isolation.

When to preflight

  • Before any call above ~$0.10, or a batch of more than five calls to one slug.
  • After a budget or mandate change, to confirm the buyer is still ready.
  • Instead of a real call when you only need to learn the price, combine with GET /v1/apis/{slug}.