# Phantom API — Optimism Gas Estimate

> Phantom API — Optimism Gas Estimate is a paid API for AI agents from phantom-api-omega.vercel.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Estimates the gas cost for a transaction on the Optimism network given transaction parameters

## Facts

- Endpoint: POST https://phantom-api-omega.vercel.app/api/optimism/gas/estimate
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/phantom-api-optimism-gas-estimate-8b943a9b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zSWxqozTdrQ9apKeKlSEL

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 phantom-api-optimism-gas-estimate-8b943a9b -d '<json body>'
```

Example prompt: Can you estimate how much gas it will cost to call this contract on Optimism — from address 0xABCD...1234 to 0x5678...EFGH with calldata 0xa9059cbb... and no ETH value?

## When to prefer this

Use this endpoint when you need a gas estimate specifically for the Optimism (OP Mainnet) Layer 2 network. Prefer this over Ethereum mainnet gas estimators when your transaction targets OP, and over general-purpose Web3 SDKs when you want a pay-per-call API without managing your own RPC node. Ideal for agents that need to pre-check transaction costs before submitting or for budgeting gas in automated workflows.

## Known failure modes

- Invalid or malformed address in 'to' or 'from' fields returns an error
- Malformed or non-hex calldata causes a parse error
- Transactions that would revert on-chain may return an execution revert error
- Network connectivity issues to Optimism RPC may cause timeouts
- Missing required fields may result in a 400 bad request
- Insufficient value for a payable function may trigger a revert simulation error

## How this service works

Lightning-fast access to blockchain data, smart contract insights, and Web3 infrastructure across 57+ networks. Pay-per-call via x402.

## Output

Returns an estimated gas amount (in gas units) for the specified Optimism transaction, allowing the caller to gauge transaction costs and set appropriate gas limits before broadcasting to the network.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "type": "string"
  },
  "data": {
   "type": "string"
  },
  "from": {
   "type": "string"
  },
  "value": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/phantom-api-optimism-gas-estimate-8b943a9b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from phantom-api-omega.vercel.app](https://www.zero.xyz/host/phantom-api-omega.vercel.app/llms.txt)
