For agents

Agent quickstart

A machine-readable map of the API. Discovery is free and unauthenticated — use it to decide what to buy. Data endpoints answer 402 until you attach a signed X-PAYMENT header. There's also an llms.txt and a live discovery JSON.

1 · Discover (free, no auth)

curl -s https://api.hyperextend.xyz/v1/discovery | jq .
EndpointAnswers
GET /v1/discoveryDex/coin counts, intervals, availability lag — one call to orient.
GET /v1/dexesEvery dex (main, HIP-3, HIP-4) with first/last seen.
GET /v1/dexes/{dex}/coinsActive universe on a dex.
GET /v1/coins/{coin}Which dexes a coin trades on.
GET /v1/availability/{coin}Per-dex first/last/row-count for ctx + candles.
GET /v1/coverage/{coin}?start=&end=Gap manifest for OI / ctx.
GET /v1/candles/{coin}/coverage?start=&end=Gap manifest for candles.

2 · Pay (x402)

Request a data endpoint → 402 with an accepts array and an instructions block. Sign an EIP-3009 transferWithAuthorization over USDC for accepts[0], base64 it into X-PAYMENT, retry the same request → 200. You need USDC on Base, not ETH — the facilitator pays gas; the receipt returns in X-PAYMENT-RESPONSE.

import httpx
from hyperextend.x402 import build_x_payment_header

url = "https://api.hyperextend.xyz/v1/candles/BTC/1m"
params = {"start": 0, "end": 1735689600000}

with httpx.Client() as client:
    r = client.get(url, params=params)
    if r.status_code == 402:                       # quote in r.json()["accepts"][0]
        reqs = r.json()["accepts"][0]
        header = build_x_payment_header(MY_PRIVATE_KEY, requirements=reqs)
        r = client.get(url, params=params, headers={"X-PAYMENT": header})
    r.raise_for_status()
    candles = r.json()
EndpointReturns
GET /v1/candles/{coin}/{interval}?start=&end=OHLCV candles, priced per row.
GET /v1/asset_ctx/{coin}?start=&end=OI / funding / mark / oracle / mid / volumes.

3 · Pricing

cost = $0.001 + rows × $0.000005   # paginate with the X-Next-Start header

Full reference: /docs. Newer than ~2 days? Query Hyperliquid directly.