GeminiGemini
Demo environmentGet API key
  • Overview
  • Crypto Trading
  • Prediction Markets
  • Perpetuals
  • Stocks
  • API Reference
  • SDKs & Tools
Changelog
Gemini logoGemini logo

© 2026 Gemini Space Station, Inc.

Overview
Core Concepts
    Events, contracts, and outcomesCombo contracts
Market Data
    OverviewFetching Markets
    Ticker formats
      OverviewCryptoSportsSports Market TaxonomyCommoditiesWeather
Trading
    QuickstartOrder lifecycle and settlement
    Full REST reference
      Combo RFQ
      Events
      Volume
      Terms
      Order Management
      Positions
      Rewards
    WebSocket APIs
      OverviewAuthenticationMessage format
      Streams
        Book tickerL2 partial depthL2 differential depthTrade streamOrder eventsBalance updatesPosition updatesContract statusPrediction
      Utility
      Subscriptions
      L2 Data
      Order management
      Combo RFQ
        OverviewWebSocket streamsQuote methodsMaker integrationExamples
Market Makers
    Maker Fee-Free Trading PromoTaker Rewards ProgramMaker Rebate ProgramLiquidity Rewards ProgramMarket Maker Program
Resources
    SchemasDemo environmentRate limitsErrors
AuthenticationMessage Format
Streams
    OverviewBook TickerL2 Partial DepthL2 Differential DepthTrade StreamOrder EventsBalance UpdatesPosition UpdatesContract Status
Utility
    conninfopingtime
Subscriptions
    SUBSCRIBEUNSUBSCRIBELIST_SUBSCRIPTIONS
L2 Data
    depth
Trading
    order.placeorder.cancelorder.cancel_allorder.cancel_session
WebSocket APIs

Message Format

Our WebSocket API uses JSON-formatted messages for all communication.

Request Format

All requests follow a consistent structure:

Code
{ "id": "1", "method": "METHOD_NAME", "params": {...} }
FieldTypeRequiredDescription
idstring | numberYesUnique identifier for matching request/response
methodstringYesThe method to invoke
paramsobject | arrayNoMethod parameters (varies by method)

Response Format

Successful responses include the request ID and result:

Code
{ "id": "1", "status": 200, "result": {...} }
FieldTypeDescription
idstring | numberMatches the request ID
statusnumberHTTP status code
resultanyMethod-specific response data

Error Response

Error responses include error details:

Code
{ "id": "1", "status": 401, "error": { "code": -1002, "msg": "Authentication required" } }
FieldTypeDescription
idstring | numberMatches the request ID
statusnumberHTTP status code
error.codenumberInternal error code
error.msgstringHuman-readable error message

Error Codes

CodeHTTP StatusDescription
-1000500Internal server error
-1002401Authentication required
-1003429Rate limit exceeded
-1013400Invalid parameters
-1020400Unsupported operation
-2010400Order rejected

Event Types

Streaming events carry an e field that identifies the event type, so a single connection can demultiplex every subscription:

e valueStream
depthUpdateL2 differential depth ({symbol}@depth, {symbol}@depth@100ms)
orderUpdateOrder events (orders@account, orders@session)
balanceUpdateBalance updates (balances@account, balances@account@1s)
positionReportPosition updates (positions@account, positions@account@1s)
contractStatusContract status (contractStatus)

The Book Ticker ({symbol}@bookTicker), L2 Partial Depth ({symbol}@depth5 / @depth10 / @depth20), and Trade ({symbol}@trade) payloads do not carry an e field — identify those by the stream you subscribed to.

New event types may be added over time. Treat any e value you do not recognize as a forward-compatible addition and ignore it.

AuthenticationStreams
JSON
JSON
JSON