# HTTPay Gas Optimizer API

> HTTPay Gas Optimizer API is a paid API for AI agents from httpay.xyz, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Returns gas optimization recommendations for Ethereum/Base transactions, helping minimize transaction costs via pay-per-call x402 micropayments.

## Facts

- Endpoint: POST https://httpay.xyz/api/gas-optimizer
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/httpay-gas-optimizer-api-ae284f56
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yTAt6y5tHHP7Tdsr1hwoA

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 httpay-gas-optimizer-api-ae284f56 -d '<json body>'
```

Example prompt: What's the optimal gas price I should use right now to minimize fees for a token swap transaction on Base — I want to avoid overpaying but still get it confirmed quickly.

## When to prefer this

Use this endpoint when you need real-time gas optimization for Base or EVM-compatible transactions and want to pay per call via USDC micropayment without managing API keys or subscriptions. Prefer over alternatives when working in a crypto-native agent context that already supports x402 payment protocol.

## Known failure modes

- Payment not provided — returns 402 with x402 payment required header
- Network congestion data unavailable — may return stale or empty recommendations
- Invalid or missing query parameters — returns 400 bad request
- Upstream gas oracle unavailable — returns 503 or empty example response

## How this service works

Gas optimizer for Base — current gas price, cost estimates for common operations, and optimal timing recommendation (live on-chain data)

## Output

Returns gas optimization data including recommended gas price, fee estimates, and cost-saving suggestions for transactions on Base network, delivered as JSON.

## Example request

```json
{
 "network": "base",
 "transaction_type": "token_swap",
 "estimated_gas_units": 150000
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {}
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/httpay-gas-optimizer-api-ae284f56/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from httpay.xyz](https://www.zero.xyz/host/httpay.xyz/llms.txt)
