# Cleave Gas Purchase (x402)

> Cleave Gas Purchase (x402) is a paid API for AI agents from api.cleave.fi, paid per call via x402, $0.8/call, status unknown (last checked 2026-12-02).

Creates a cross-chain gas-top-up order: pay USDC on Base, Arbitrum, or Polygon to receive native gas tokens on Ethereum, Arbitrum, Base, BNB Chain, Polygon, or Optimism.

## Facts

- Endpoint: GET https://api.cleave.fi/x402/gas?utm_source=zero.xyz
- Price: $0.8/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/cleave-gas-purchase-x402-c173c51d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9KlqYdIS0RATqLJGNcwg2

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 cleave-gas-purchase-x402-c173c51d
```

Example prompt: I need to top up gas on Arbitrum — send at least 0.01 ETH worth of native gas to my wallet 0xABCD...1234, and I want to pay with 10 USDC from Base.

## When to prefer this

Use this endpoint when an agent or user needs to deliver native gas tokens to an EVM address without already holding native tokens on that chain, and wants to pay exclusively in USDC. Prefer this over manual bridging when the destination is one of the supported chains (Ethereum, Arbitrum, Base, BNB Chain, Polygon, Optimism) and the payment source is USDC on Base, Arbitrum, or Polygon. The automatic refund mechanism makes it safer than raw bridge calls for programmatic agent use.

## Known failure modes

- Quote expired — deadline passed with no payment, order is auto-refunded
- Arrival swap failure — if payment came from another chain and the final swap fails, USDC is delivered instead of native gas
- Refund delay — cross-chain unfilled orders may take hours to refund
- Invalid chain ID — unsupported destination or payment chain returns error
- Recipient address malformed — regex validation failure on address fields
- Amount too low — USDC amount below minimum threshold for viable gas delivery

## How this service works

Native gas on Ethereum, Arbitrum, Base, BNB Chain, Polygon or Optimism, paid in USDC on Base, Arbitrum or Polygon. Orders: 0.8-50 USDC; gas on Ethereum 5-50. Send pay, chainId, recipient, usdc (cross-chain: wallet or refundTo) for an offer; the bare URL is a sample. A one-order address is written to swap USDC toward native gas, or to bridge and swap on arrival. It may yield native coin, USDC on arrival or a refund, or stay unresolved. Nothing is guaranteed; a settled payment is not delivery.

## Output

A JSON object containing: 'payTo' (the one-time payment address to send USDC to), 'minimum' (guaranteed minimum native gas to be delivered), 'deadline' (Unix timestamp by which payment must be made), 'requestId' (unique order identifier), 'state' (e.g. 'pending'), and 'fee' (service fee charged). The agent pays USDC to 'payTo' before the deadline to trigger native gas delivery to the recipient address.

## 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": [
      "pay",
      "chainId",
      "recipient",
      "usdc"
     ],
     "properties": {
      "pay": {
       "type": "string",
       "pattern": "^[1-9][0-9]{0,9}$",
       "description": "The chain the USDC is paid on"
      },
      "usdc": {
       "type": "string",
       "pattern": "^[0-9]{1,9}(\\.[0-9]{1,6})?$",
       "description": "The USDC amount to pay"
      },
      "wallet": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "The paying wallet; it is the refund address when refundTo is not given. It does not set the recipient"
      },
      "chainId": {
       "type": "string",
       "pattern": "^[1-9][0-9]{0,9}$",
       "description": "The chain the native gas is for"
      },
      "refundTo": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "The refund address on the paying chain; a cross-chain quote needs refundTo or wallet"
      },
      "recipient": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "The wallet that receives the gas. If your wallet pays for a person, ask them for it; if their own wallet pays, it can be the recipient. Use your own wallet only for your own gas"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "fee": "…",
  "payTo": "0x…",
  "state": "pending",
  "minimum": "…",
  "deadline": 0,
  "requestId": "g:8453:0x…"
 }
}
```

## More

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