# AgenticFi Gas Estimation API

> AgenticFi Gas Estimation API is a paid API for AI agents from defi-api.agenticfi.wtf, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Estimates gas fees for a specified transaction type on a given blockchain network

## Facts

- Endpoint: GET https://defi-api.agenticfi.wtf/api/gas/estimate
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agenticfi-gas-estimation-api-36f98ffd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YywOqNfoIG3DjXs2UUSmG

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agenticfi-gas-estimation-api-36f98ffd
```

Example prompt: What's the estimated gas cost for a simple token swap on Base right now?

## When to prefer this

Use this endpoint when an AI agent needs to estimate gas costs before executing a DeFi transaction on Base, Ethereum, Arbitrum, or other supported chains — especially useful for pre-flight checks before swaps, bridges, NFT mints, or lending deposits to avoid failed transactions due to insufficient gas.

## Known failure modes

- Missing required 'chain' query parameter returns validation error
- Missing required 'txType' query parameter returns validation error
- Unsupported chain name returns error or empty result
- Unsupported txType value returns error
- Payment not provided or insufficient USDC returns 402 payment required
- Network or RPC unavailability may cause timeout or error

## How this service works

Gas estimate for a transaction type - transfer, swap, bridge, mint, etc.

## Output

Returns a gas estimate for the specified transaction type on the given chain, including fee data useful for pre-flight cost analysis before submitting an on-chain transaction.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "chain": "base",
   "txType": "swap_simple"
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "chain",
      "txType"
     ],
     "properties": {
      "chain": {
       "type": "string",
       "title": "chain (required)",
       "description": "Required. Chain name Examples: base, ethereum, arbitrum"
      },
      "txType": {
       "type": "string",
       "title": "txType (required)",
       "description": "Required. Transaction type (transfer, erc20_transfer, swap_simple, bridge, nft_mint, lending_deposit, etc.) Examples: swap_simple, transfer"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agenticfi-gas-estimation-api-36f98ffd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi-api.agenticfi.wtf](https://www.zero.xyz/host/defi-api.agenticfi.wtf/llms.txt)
