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"}'| Field | Rule |
|---|---|
| messages | Non-empty array of {role: user | assistant, content}; last one from the user; last 10 kept, 1,500 characters each |
| wallet | null or a 0x address (40 hex characters); its Hyperliquid mainnet account goes into the snapshot |
| coin | Ticker like BTC (1–12 letters or digits); defaults to BTC |
| Status | Meaning |
|---|---|
| 200 | Streamed answer |
| 400 | Body failed validation; error says why |
| 429 | Rate limit: 8 questions per minute per IP |
| 502 | The model returned an error or no answer |
| 503 | Ask is not configured on this deployment |
Note · Higher-limit Pro API access to market, rule-checker and track-record data is in progress.