# Perp Gap API – Live Multi-Venue Stock Quote

> Perp Gap API – Live Multi-Venue Stock Quote is a paid API for AI agents from perp-gap-api.perpgap.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-29).

Returns best live price, perp mark/mid, gap vs reference, and cross-venue spread for 1–10 stock tickers across Hyperliquid, Aster, Lighter, OKX, xStocks, and Ondo

## Facts

- Endpoint: GET https://perp-gap-api.perpgap.workers.dev/quote?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/perp-gap-api-live-multi-venue-stock-quote-7b45a305
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_W57hrsB6cYBg7trP_JtOU

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability perp-gap-api-live-multi-venue-stock-quote-7b45a305
```

Example prompt: Before I trade, pull the best live perp price for NVDA across Hyperliquid, Aster, Lighter, and OKX — I want to see the mark and mid, the gap vs last US close, the session reference price, and the best bid/ask right now.

## When to prefer this

Use this endpoint when an agent needs a consolidated, real-time best-price view across multiple tokenized stock and perp venues (Hyperliquid, Aster, Lighter, OKX, xStocks, Ondo) for 1–10 tickers before executing a trade. Prefer it over single-venue APIs when cross-venue spread, gap analysis, or venue selection is part of the decision. Not suitable for historical data, order execution, or non-stock assets.

## Known failure modes

- 400 – Bad or malformed ticker parameter (never charged)
- 402 – Payment required; call was unpaid or payment failed
- 404 – Ticker or market not listed on any tracked venue (checked before settlement, never charged)
- 502 – Upstream venue data unavailable or error fetching live prices

## How this service works

Use when an agent needs the best live price for a stock across venues before trading. For 1-10 tickers: perp mark and mid on trade.xyz (Hyperliquid), Aster, Lighter and OKX, xStocks and Ondo token prices per share, last US close, the session reference price, gap % vs it, cross-venue spread, best bid/ask and freshness. Unpaid calls get 402; bad or unknown tickers get 400/404 before any charge. Errors: 400, 402, 404, 502. Data, not advice.

## Output

A JSON object per ticker containing: perp mark price and mid from each listed venue (Hyperliquid/trade.xyz, Aster, Lighter, OKX), xStocks and Ondo token prices per share, last US close, session reference price, gap percentage versus reference, cross-venue spread, best bid and best ask, US session label (pre/regular/after-hours/overnight), and data freshness timestamps. Errors return JSON with an error string and optional hint.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "ticker"
     ],
     "properties": {
      "ticker": {
       "type": "string",
       "pattern": "^[A-Za-z0-9.]{1,12}$",
       "examples": [
        "NVDA"
       ],
       "description": "Stock ticker, case-insensitive (free list: GET /catalog)."
      },
      "tickers": {
       "type": "string",
       "pattern": "^[A-Za-z0-9.,]{1,130}$",
       "examples": [
        "NVDA,TSLA"
       ],
       "description": "Optional alternative to ticker: up to 10 comma-separated tickers."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "as_of": {
       "type": "string"
      },
      "perps": {
       "type": "object"
      },
      "ticker": {
       "type": "string"
      },
      "tokens": {
       "type": "object"
      },
      "sources": {
       "type": "array"
      },
      "summary": {
       "type": "object"
      },
      "reference": {
       "type": "object"
      },
      "last_close": {
       "type": "object"
      },
      "us_session": {
       "type": "string"
      }
     },
     "description": "Error responses are JSON {error: string, hint?: string}. 400 bad params (never charged); 402 payment required; 404 ticker/market not listed (checked before settlement, never charged); 502 upstream error. Full field docs: /openapi.json."
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/perp-gap-api-live-multi-venue-stock-quote-7b45a305/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from perp-gap-api.perpgap.workers.dev](https://www.zero.xyz/host/perp-gap-api.perpgap.workers.dev/llms.txt)
