# HTTPay L2 Gas Costs API

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

Returns real-time gas costs in USD across 7 Layer 2 blockchain networks

## Facts

- Endpoint: POST https://httpay.xyz/api/l2-costs
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/httpay-l2-gas-costs-api-391d1ff8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_C2S5IIxWDjrVAFqNu180O

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-l2-gas-costs-api-391d1ff8 -d '<json body>'
```

Example prompt: What are the current gas fees in USD across all 7 Layer 2 networks right now — I want to know which L2 is cheapest before I submit my transaction?

## When to prefer this

Use this endpoint when you need a quick, up-to-date snapshot of transaction costs across multiple L2 networks in a single call, especially when deciding which chain to use for a DeFi operation or cross-chain transfer. Ideal for agents that need to optimize gas spend without subscribing to a dedicated gas oracle service — pay only $0.05 per call with no API key required.

## Known failure modes

- Payment required (402) if USDC micropayment not included
- Network timeout if L2 RPC nodes are slow to respond
- Stale data if upstream gas oracles are lagging
- Empty or partial results if some L2 networks are temporarily unreachable

## How this service works

Real-time gas costs across 7 L2s in USD

## Output

A JSON object containing real-time gas costs denominated in USD for 7 different L2 blockchain networks, allowing comparison of transaction fees across chains at the moment of the request.

## Example request

```json
{}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "description": "Real-time gas costs across 7 L2s in USD"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/httpay-l2-gas-costs-api-391d1ff8/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)
