Buy $LEVER
Leverra Docs
Developers

Public API

The app worker's two endpoints.

Base URL: https://dapp.leverra.app. Responses are JSON unless noted. No CORS headers are set, so call it from a server or script.

GET /api/markets

Every perp on Hyperliquid, dYdX and Aster in one shape. Edge-cached for 15 seconds. A venue that fails is listed in errors; the others still return.

curl https://dapp.leverra.app/api/markets

{
  "at": 1764660000000,          // ms timestamp of the snapshot
  "markets": [
    {
      "venue": "hyperliquid",   // "hyperliquid" | "dydx" | "aster"
      "coin": "BTC",            // base asset, upper case
      "mark": 0,                // mark price (dYdX: oracle price)
      "change24h": 0,           // fraction, 0.01 = +1%, or null
      "fundingHourly": 0,       // fraction per hour, normalised
      "oiUsd": 0,               // open interest in USD, or null
      "volUsd": 0               // 24h notional volume in USD, or null
    }
  ],
  "errors": { "aster": "503" }  // only venues that failed
}

GET /api/ask

curl https://dapp.leverra.app/api/ask
{ "ok": true, "model": "openai/gpt-6-luna" }

POST /api/ask

Streams the answer as plain text (text/plain). The x-model header names the model.

curl -N https://dapp.leverra.app/api/ask \
  -H 'content-type: application/json' \
  -d '{"messages":[{"role":"user","content":"Where is funding most negative?"}],"wallet":null,"coin":"BTC"}'
FieldRule
messagesNon-empty array of {role: user | assistant, content}; last one from the user; last 10 kept, 1,500 characters each
walletnull or a 0x address (40 hex characters); its Hyperliquid mainnet account goes into the snapshot
coinTicker like BTC (1–12 letters or digits); defaults to BTC
StatusMeaning
200Streamed answer
400Body failed validation; error says why
429Rate limit: 8 questions per minute per IP
502The model returned an error or no answer
503Ask is not configured on this deployment
Note · Higher-limit Pro API access to market, rule-checker and track-record data is in progress.