# API Specifications

Use these machine-readable source specifications when generating clients, validating payloads, or giving agents a stable contract to inspect.

## Spec catalog

- <a href="/specs/index.json" target="_blank" rel="noopener noreferrer">Spec catalog</a> — JSON index of every published OpenAPI and AsyncAPI source file, including canonical URLs, compatibility aliases, versions, and related docs.

## Crypto Trading

- <a href="/specs/openapi/rest.yaml" target="_blank" rel="noopener noreferrer">Crypto Trading REST OpenAPI spec</a> — source contract for Gemini Exchange REST APIs. Compatibility alias: <a href="/rest.yaml" target="_blank" rel="noopener noreferrer"><code>/rest.yaml</code></a>. Rendered reference: [Crypto Trading REST API reference](/rest).
- <a href="/specs/asyncapi/websocket.yaml" target="_blank" rel="noopener noreferrer">Crypto Trading WebSocket AsyncAPI spec</a> — source contract for the production `wss://ws.gemini.com` WebSocket request/response methods, market data streams, and authenticated streams. Compatibility alias: <a href="/websocket.yaml" target="_blank" rel="noopener noreferrer"><code>/websocket.yaml</code></a>.

## Prediction Markets

- <a href="/specs/openapi/prediction-markets.yaml" target="_blank" rel="noopener noreferrer">Prediction Markets OpenAPI spec</a> — source contract for Prediction Markets REST APIs. Compatibility alias: <a href="/prediction-markets.yaml" target="_blank" rel="noopener noreferrer"><code>/prediction-markets.yaml</code></a>. Rendered reference: [Prediction Markets API reference](/prediction-markets-spec).
- <a href="/specs/asyncapi/websocket.yaml" target="_blank" rel="noopener noreferrer">Prediction Markets WebSocket AsyncAPI spec</a> — shared WebSocket source contract covering Prediction Markets streams, authenticated streams, order methods, and combo RFQ messages. Compatibility alias: <a href="/websocket.yaml" target="_blank" rel="noopener noreferrer"><code>/websocket.yaml</code></a>.

## WebSocket coverage

| Surface | Machine-readable coverage | Notes |
|---|---|---|
| Request/response envelope | Full | Standard `id`, `method`, `params`, `status`, `result`, and `error` shapes are modeled. |
| Utility methods (`conninfo`, `ping`, `time`) | Partial | Request envelopes are modeled; result bodies are broad because the docs do not enumerate every field. |
| Subscription methods (`SUBSCRIBE`, `UNSUBSCRIBE`, `LIST_SUBSCRIPTIONS`) | Full | Uppercase Prediction Markets and lowercase Trading variants are both accepted in the spec. |
| Market data streams | Full | Book ticker, partial depth, differential depth, and trade stream payloads are modeled. |
| Trading methods | Partial | `order.place`, `order.cancel`, `order.cancel_all`, and `order.cancel_session` requests are modeled; order lifecycle state is modeled on the `orderUpdate` stream. |
| Authenticated account streams | Full | Order, balance, and position stream payloads are modeled. |
| Contract lifecycle stream | Full | `contractStatus` payloads are modeled. |
| Combo RFQ streams and methods | Full | Public/private RFQ deliveries and quote submit/withdraw/confirm methods are modeled. |
| Archived WebSocket v1/v2 APIs | Docs-only | Archived APIs remain documented for reference but are intentionally excluded from the current AsyncAPI contract. |

## Agent usage

Agents should fetch <a href="/llms.txt" target="_blank" rel="noopener noreferrer"><code>/llms.txt</code></a> first for the documentation index, then <a href="/specs/index.json" target="_blank" rel="noopener noreferrer"><code>/specs/index.json</code></a> for machine-readable API contracts. Use the catalog entry's `url` field as the canonical spec URL; root-level aliases remain available for existing integrations. For WebSocket coverage, read the AsyncAPI spec's `x-gemini-coverage` metadata before assuming a method response body is fully enumerated.
