> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ironflow.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Pay per call with x402: Hyperliquid data for agents, no account

> AI agents and scripts can pay for single Ironflow API calls in USDC on Base with x402: from $0.001 a request, $0.01 a SQL query, no account or key, served at Builder limits.

An agent that needs more than the free limits does not have to buy a plan first. It can pay for the one call it needs, in USDC on Base, using [x402](https://x402.org), the HTTP payment standard.

| | Price | What the call gets |
| - | - | - |
| Markets snapshot, order book (`/v1/markets/snapshot`, `/v1/book`) | \$0.001 | Every market's price, open interest, funding and volume; a live L2 book |
| Trades, candles, funding (`/v1/trades`, `/v1/candles`, `/v1/funding`) | \$0.002 | Builder limits for that call: 1 year of history, 7-day windows |
| Any other data request | \$0.005 | Builder limits for that call |
| SQL query (`/v1/query`) | \$0.01 | Builder SQL: 1 year back, 30 s, 10,000 rows |

No account, no key, no subscription. Calls inside your free limits stay free.

## How it works

When a request hits a limit that one paid call lifts (the keyless daily cap, history older than your tier, a query window, SQL time), the API answers **402 Payment Required** instead of 403 or 429. The response still carries the usual JSON error, plus x402's `PAYMENT-REQUIRED` header with the price and where to pay. An x402 client signs a USDC payment and retries the same request with a `PAYMENT-SIGNATURE` header; the API serves it at the Builder tier and returns `PAYMENT-RESPONSE` with the transaction.

To pay from the first call, use the same paths under `/x402`: `https://api.ironflow.sh/x402/v1/liquidations` always asks for payment, then serves exactly what `/v1/liquidations` serves.

You are charged only for calls that succeed: a call that fails is not settled, and if a payment cannot be settled, no data is sent.

## With @x402/fetch

```typescript theme={null}
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }], // Base
});

// BTC liquidations from 90 days ago: older than the free tier reaches, so this
// call pays $0.005 and is served at Builder limits (one year of history)
const res = await fetchWithPayment(
  "https://api.ironflow.sh/v1/liquidations?market=BTC&from=-90d&to=-89d&limit=100",
);
console.log(await res.json());
```

The wallet needs a little USDC on Base; the payment covers gas, so it needs no ETH. Coinbase's AgentKit, Cloudflare's agents SDK and other x402 clients work the same way.

## Listed in the x402 Bazaar

These are declared to Coinbase's x402 Bazaar (agentic.market), with descriptions, example inputs and output schemas, so an agent searching it can find and call them. The same list, with prices and schemas, is at [api.ironflow.sh/openapi.json](https://api.ironflow.sh/openapi.json) (OpenAPI 3.1 with `x-payment-info`), which x402 registries such as x402scan read:

| Endpoint | Price | Use it for |
| - | - | - |
| `GET /x402/v1/liquidations` | \$0.005 | Liquidations by market, wallet or window |
| `GET /x402/v1/liquidations/summary` | \$0.005 | Long and short USD liquidated per window and market |
| `GET /x402/v1/analytics/liquidation-levels` | \$0.005 | Price levels where longs and shorts were liquidated |
| `GET /x402/v1/trades` | \$0.002 | Every fill for a market or wallet |
| `GET /x402/v1/candles` | \$0.002 | OHLCV, 1m to 1w |
| `GET /x402/v1/funding` | \$0.002 | Funding rate history |
| `GET /x402/v1/markets/snapshot` | \$0.001 | Every market's price, open interest, funding and volume |
| `GET /x402/v1/book` | \$0.001 | Live L2 order book of a market |
| `GET /x402/v1/open-interest/changes` | \$0.005 | Open interest movers |
| `GET /x402/v1/analytics/user-state` | \$0.005 | A wallet's open positions |
| `GET /x402/v1/analytics/leaderboard-pnl` | \$0.005 | Top traders by realized PnL |
| `GET /x402/v1/predictions/summary` | \$0.005 | HIP-4 outcome market activity |
| `POST /x402/v1/query` | \$0.01 | SQL over every hl.\* table |

## What can be paid for

Every read endpoint under `/v1`, and SQL. Live streams, liquidation alerts, keys and billing need a [free key](https://ironflow.sh/key) instead, and the per-minute rate limit still answers 429 with `Retry-After`. For steady use a [plan](https://docs.ironflow.sh/concepts/plans-and-payment.md) is cheaper: Explorer at 49 USDC for 30 days costs what 10,000 to 25,000 paid calls would.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.