Estimate transaction cost¶
POST /api/quote
Estimate what a transaction will cost before submitting it. The body is the same shape as POST /api/submit-tx. Returns 201 with the estimated cost in USD and minBalanceRequired - the worst-case native cost plus the 8% funding service fee, as a base-10 integer string in the chain's smallest unit - suitable for passing to POST /api/submit-signed-tx. Nothing is queued or charged.
Authentication
Send your API key in the api-key header.
Request body (application/json)
{
"to": "0xA7A833e6641D7901F30EaD6f27d4Ee2C9bb670a7",
"callData": "0x",
"chainId": 8453,
"value": "1000000000000000"
}
Responses
| Status | Description |
|---|---|
201 |
Cost estimate computed. |
400 |
Invalid request. Plausible codes: VALIDATION_004 (schema validation failed), TRANSACTION_005 (invalid gas parameters), CHAIN_001 (unsupported chain), VALIDATION_001 (the transaction is invalid for the target chain). |
401 |
Authentication failed. Plausible codes: AUTH_002 (invalid API key). |
429 |
Rate limit exceeded for this API key. Plausible codes: RESOURCE_003. |
500 |
Estimation failed. Plausible codes: TRANSACTION_004 (execution reverted during simulation; details carries the revert reason), CHAIN_003 (blockchain RPC error), SYSTEM_002. |