TERMINAL API CREDITS SWAGGER DOCS ↗
[GUIDE]

API User Guide

The complete reference: authentication, tiers, rate limits, every endpoint, webhooks, error codes and code examples.

1. Getting Started

1.1 Base URL

https://frontend-theta-smoky-58.vercel.app/api/v1/...

All endpoints return JSON. Everything is read from HyperBasis infrastructure (ClickHouse/Postgres) — your requests never touch third-party quote APIs directly (read/write separation).

1.2 Authentication — wallet-bound API key

Every API key is bound to your wallet. Get yours on the Get API Key page (connect MetaMask / Rabby / Coinbase / Phantom, sign one message, done).

curl -H "X-API-Key: hb_live_..." https://frontend-theta-smoky-58.vercel.app/api/v1/deviation

1.3 Your first call

# latest deviation for every asset
curl -H "X-API-Key: hb_live_..." \
  https://frontend-theta-smoky-58.vercel.app/api/v1/deviation

# response (excerpt)
[
  {
    "name": "AAPL",
    "hl_price": 302.10,
    "tradfi_price": 305.48,
    "deviation_pct": -1.11,
    "deviation_percentile_90d": 4.2,
    "timestamp": "2026-08-18 11:19:03",
    "is_stale": false,
    "last_quote_at": "2026-08-18T12:18:40Z"
  }, ...
]

2. Tiers

FeatureFREEPROENTERPRISE
History window90 days2 years2 years
Realtime deviation5-minute delayed90-second cyclesub-second (WebSocket)
Daily API calls100/day10,000/dayunlimited
Per-minute calls10/min1,000/mincustom
Webhooks✓ + SLA
Credits (pay-per-use)✓ buy with USDC

Upgrade: 29 USDC → PRO 30 days. Every response carries your tier + limits (see §5).

3. Every Endpoint

3.1 Market Data

EndpointDescription
GET/api/v1/deviationLatest deviation for all assets (HL vs TradFi) with is_stale/last_quote_at.
POST/api/v1/deviation/batchUp to 50 assets in ONE call. Body: {"assets":["TSLA","NVDA","GOLD"]}. Counts as 1 call.
GET/api/v1/yieldArbitrage yield per asset (funding + deviation − friction), 90d percentile.
GET/api/v1/leaderboard?view=actionable|all|micro|stale|warningsSignal leaderboard with hard Actionable filters (fresh data, liquidity, funding alignment).
GET/api/v1/microstructure?asset=TSLAOrderbook toxicity & microstructure snapshot for algos.
GET/api/v1/risk_flags/{asset}Market-halted / oracle-stale / corporate-action flags.
GET/api/v1/deviation/history?asset=TSLA&days=7&interval=1h|1mHistorical deviation series. 1m costs credits (~5/500 rows); window capped by tier.
GET/api/v1/assetsFull asset universe metadata (98 instruments).
GET/api/v1/borrow-costsBorrow cost per asset (short-side friction).
GET/api/v1/macro-eventsMacro calendar events.

3.2 Funding, OI & Capacity

EndpointDescription
GET/api/v1/oi-funding/history?asset=TSLA&days=7Open interest + funding history.
GET/api/v1/capacity/history?asset=TSLA&days=7Capacity/depth history.
GET/api/v1/export/deviation.csv?asset=TSLA&days=30CSV export of deviation history.

3.3 Whale & Liquidation Intelligence

EndpointDescription
GET/api/v1/whale/positionsPositions of the tracked whale pool (282 addresses).
GET/api/v1/whale/addressesTracked whale addresses.
GET/api/v1/whale/flowsWhale flow events.
GET/api/v1/liquidation/map?asset=TSLALiquidation price map per asset.
GET/api/v1/liquidation/eventsLiquidation events (limited by HL API data availability).
GET/api/v1/liquidation/vulnerability?asset=TSLALiq vulnerability score 0-100.
GET/api/v1/gap-risk?asset=TSLA&test_mode=trueWeekend/close gap risk index.

3.4 Signals & Analytics

EndpointDescription
GET/api/v1/alerts/extreme?threshold_high=90&threshold_low=10Extreme 90d-percentile alerts (drives webhooks).
GET/api/v1/backtest?asset=TSLA&days=30Mean-reversion backtest with equity curve.
GET/api/v1/analytics/correlation?days=30Cross-asset deviation correlation matrix (95×95, ~50s).
GET/api/v1/analytics/regimeMarket regime detection (~60s).

3.5 Webhooks (institutional)

EndpointDescription
POST/api/v1/webhooksRegister. Body: {"url":"https://your-callback","events":["extreme"]}. Returns HMAC secret (shown once).
GET/api/v1/webhooksList your webhooks.
DELETE/api/v1/webhooks/{id}Delete.

Delivery format (when /alerts/extreme finds signals):

POST https://your-callback
X-HyperBasis-Signature: sha256=<HMAC-SHA256(secret, raw_body)>
X-HyperBasis-Event: extreme

{"generated_at":"2026-08-18T11:36:56Z","alerts":[{"asset":"SKHX","deviation_pct":-17.48,"percentile_90d":0,"flag":"EXTREME_LOW"},...]}

Verify the signature before trusting the payload (max 1 delivery per webhook per 5 minutes).

3.6 WebSocket (realtime stream)

wss://frontend-theta-smoky-58.vercel.app/ws/v1/stream?api_key=hb_live_...&assets=TSLA
# costs 10 credits/hour - requires credits balance

3.7 Billing & Credits

GET/api/v1/credits/balanceYour credit balance.
GET/api/v1/credits/usageCredit consumption per day/endpoint.
GET/api/v1/billing/productsAvailable products.
GET/api/v1/billing/usageAPI call usage metering.
POST/api/v1/billing/checkoutStripe checkout session.

Buy credits on-chain with USDC: API Credit page (10 USDC = 1,000 credits; 50 = 5,000; 100 = 10,000).

4. Data Quality Flags

Every pricing response includes:

5. Response Meta & Rate-Limit Headers

HTTP/1.1 200 OK
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9998
X-RateLimit-Reset: 1787097600
X-RateLimit-Minute-Limit: 1000
X-RateLimit-Minute-Remaining: 997

{"asset":"TSLA", ..., "_meta":{"tier":"pro","generated_at":"2026-08-18T12:20:11Z"}}

6. Error Codes

CodeMeaning
401Missing or invalid API key / wallet token.
402Insufficient credits for a paid endpoint (minute history, WebSocket).
403Key inactive or CORS origin rejected.
422Missing/invalid parameters (e.g. asset required on liquidation endpoints).
429Rate limit exceeded: "Daily quota exceeded (free: 100/day)" — upgrade to PRO.
500Server error — retry with backoff; report with the Request ID.

7. Full Examples

# 1) batch deviation (1 call)
curl -X POST -H "X-API-Key: hb_live_..." -H "Content-Type: application/json" \
  -d '{"assets":["TSLA","NVDA","GOLD"]}' \
  https://frontend-theta-smoky-58.vercel.app/api/v1/deviation/batch

# 2) actionable signals
curl -H "X-API-Key: hb_live_..." \
  "https://frontend-theta-smoky-58.vercel.app/api/v1/leaderboard?view=actionable&sort_by=yield"

# 3) register a webhook (save the secret!)
curl -X POST -H "X-API-Key: hb_live_..." -H "Content-Type: application/json" \
  -d '{"url":"https://your-server/wh","events":["extreme"]}' \
  https://frontend-theta-smoky-58.vercel.app/api/v1/webhooks

# 4) verify a webhook delivery (Python)
import hmac, hashlib
expected = "sha256=" + hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
assert request.headers["X-HyperBasis-Signature"] == expected
Honest limitations: zero-volume HL assets (ALUMINIUM, VIX, DXY…) have no funding history; some assets have no TradFi quote (is_stale stays true); same-day US equity minute bars lag one trading day on the free data plan; liquidation events are limited by HL API availability.