POST the already-built transaction as JSON to https://quoter.api.enso.build/api/v1/simulate with a Bearer API key. Then, before signing, POST the simulationId and unsigned transaction to /api/v1/validate.
Definition
curl is just an HTTP client for the same simulate-then-validate flow. You still send chainId, transaction, tokenIn, tokenOut, and amountIn, and you still sign only when valid is true.
How it works
Set
ENSO_API_KEYto your Developer Portal key.POST a JSON body to
/api/v1/simulatewithContent-Type: application/jsonandAuthorization: Bearer $ENSO_API_KEY.Read
result.status,result.amountOut,result.gas, andsimulationIdfrom the response. HTTP 200 is not enough; checkresult.status.Within five minutes, POST to
/api/v1/validatewith thatsimulationIdand the unsignedtransactionfields (data,to,from,value,chainId).For up to five already-built transactions that share the same token-flow fields, POST to
/api/v1/simulate/batchinstead.
How Enso does this
The Quoter overview and Simulating Transactions show this HTTP interface. You can also pass the key as api_key on the query string. Quoter does not modify the transaction you later submit.
FAQ
Where do I get the transaction fields?
From the calldata you already built (to, data, value, from) and the chain you will submit on. If Enso should build the path, call the Route API instead of composing calldata by hand.
What if curl returns 401 or 404?
401 means the key is missing or invalid. 404 on validate means the simulationId was not found or expired; simulate again.
Related articles
How do I authenticate Enso Quoter requests?
How do I simulate a DeFi transaction before sending it?
How do I simulate multiple transactions at once?
Why is my Quoter simulation status Error but the HTTP status is 200?
How do I submit Enso transaction data from my app?
