# Base Gas Budget Check

> Base Gas Budget Check is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Validates a caller-supplied Base gas price and gas limit against an ETH transaction budget using exact Wei arithmetic, returning fee estimate, budget headroom, and optional USD estimate.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/base-gas-budget-check
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-gas-budget-check-d02e01c3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hxhPynClVmkqWEPxlsQEO

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 base-gas-budget-check-d02e01c3 -d '<json body>'
```

Example prompt: Before I sign this Base transaction, check if my budget of 0.005 ETH is enough for a gas limit of 200000 at 1.5 gwei — ETH is currently $3200, so give me the USD estimate too.

## When to prefer this

Use this endpoint immediately after fetching live gas data from get_base_gas or get_base_estimate_gas as a fail-closed preflight before signing any Base transaction. Prefer it when you need exact Wei arithmetic validation without making a live RPC call, want an integrated USD cost estimate, or are running an autonomous agent that must gate on budget before committing on-chain actions.

## Known failure modes

- gas_limit exceeds 30,000,000 maximum → validation error
- gas_price_gwei or budget_eth is negative or zero → rejected by schema
- eth_usd not supplied → USD estimate omitted from response
- Computed fee exceeds budget_eth → returns fail verdict with negative headroom
- Malformed JSON body → 400 bad request

## How this service works

Check a caller-supplied Base gas price and gas limit against an ETH transaction budget with exact Wei arithmetic. Use immediately after get_base_gas or get_base_estimate_gas to fail closed before signing. Returns estimated fee, budget headroom, and an optional USD estimate for 0.001 USDC via x402 on Base; no live RPC or custody.

## Output

Returns the estimated transaction fee in ETH (gas_price_gwei × gas_limit in exact Wei), remaining budget headroom in ETH, a pass/fail budget verdict, and an optional USD cost estimate if eth_usd is supplied. No live RPC calls or custody involved.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "eth_usd": {
   "type": "number",
   "exclusiveMinimum": 0
  },
  "gas_limit": {
   "type": "integer",
   "maximum": 30000000,
   "minimum": 1
  },
  "budget_eth": {
   "type": "number",
   "minimum": 0
  },
  "gas_price_gwei": {
   "type": "number",
   "minimum": 0
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "schema": "delx/util-base-gas-budget-check/v1",
  "budget_eth": "0.00001",
  "budget_wei": "10000000000000",
  "headroom_eth": "0.00000832",
  "headroom_wei": "8320000000000",
  "within_budget": true,
  "estimated_fee_eth": "0.00000168",
  "estimated_fee_usd": "0.00588",
  "estimated_fee_wei": "1680000000000"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-gas-budget-check-d02e01c3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
