> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graylayer.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini

> Prediction market categories, events, and market data

<Card title="Join the Graylayer Discord" icon="discord" href="https://discord.gg/UxGa5C4C2A" horizontal>
  Request an API key in **#api-key-request** under the Community tab.
</Card>

**Platform key:** `gemini` · **Upstream:** `https://api.gemini.com`

Public endpoints (categories, events, order books, trades, positions, order history) need no platform credentials.

<Note>
  Use the sandbox for testing by setting `GEMINI_BASE_URL=https://api.sandbox.gemini.com` in `.env`.
</Note>

```bash theme={null}
curl -H "X-API-Key: your_key" \
  http://gateway.graylayer.tech/api/v1/gemini/v1/prediction-markets/categories
```

## Prediction markets

| Method | Path                                     | Description         |
| ------ | ---------------------------------------- | ------------------- |
| GET    | `/v1/prediction-markets/categories`      | List categories     |
| GET    | `/v1/prediction-markets/events`          | List events         |
| GET    | `/v1/prediction-markets/events/{ticker}` | Get event by ticker |
| POST   | `/v1/prediction-markets/positions`       | Get positions       |
| POST   | `/v1/prediction-markets/orders/active`   | Get active orders   |
| POST   | `/v1/prediction-markets/orders/history`  | Get order history   |

<CodeGroup>
  ```bash List categories theme={null}
  curl -H "X-API-Key: your_key" \
    http://gateway.graylayer.tech/api/v1/gemini/v1/prediction-markets/categories
  ```

  ```bash List events theme={null}
  curl -H "X-API-Key: your_key" \
    http://gateway.graylayer.tech/api/v1/gemini/v1/prediction-markets/events
  ```

  ```bash Get event theme={null}
  curl -H "X-API-Key: your_key" \
    http://gateway.graylayer.tech/api/v1/gemini/v1/prediction-markets/events/TRUMPWIN
  ```
</CodeGroup>

## Market data

| Method | Path                  | Description           |
| ------ | --------------------- | --------------------- |
| GET    | `/v1/book/{symbol}`   | Order book for symbol |
| GET    | `/v1/trades/{symbol}` | Recent trades         |
| GET    | `/v2/ticker/{symbol}` | Ticker data           |

<CodeGroup>
  ```bash Ticker theme={null}
  curl -H "X-API-Key: your_key" \
    http://gateway.graylayer.tech/api/v1/gemini/v2/ticker/BTCUSD
  ```

  ```bash Recent trades theme={null}
  curl -H "X-API-Key: your_key" \
    http://gateway.graylayer.tech/api/v1/gemini/v1/trades/BTCUSD
  ```
</CodeGroup>

## WebSocket

Real-time Gemini data via WebSocket proxy. See [Gemini WebSockets](/websockets/gemini).
