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

# Quickstart Guide - Connect to Odds API in Minutes

> Get started with OddsPapi in minutes. Connect to the WebSocket gateway, authenticate with your API key, subscribe to channels, and stream realtime sports odds data.

## 1) Connect

Gateway:

* **ws**: `wss://v5.oddspapi.io/ws`

<Tabs>
  <Tab title="JavaScript (Node)">
    ```js theme={null}
    import WebSocket from "ws";

    const ws = new WebSocket("wss://v5.oddspapi.io/ws");

    ws.on("open", () => {
      ws.send(JSON.stringify({ type: "login", apiKey: process.env.ODDS_API_KEY }));
    });

    ws.on("message", (data) => {
      const msg = JSON.parse(data.toString());
      console.log(msg.type ?? msg.channel, msg);
    });
    ```
  </Tab>

  <Tab title="Python">
    ```py theme={null}
    import json
    import os
    import websocket

    def on_open(ws):
        ws.send(json.dumps({
            "type": "login",
            "apiKey": os.environ["ODDS_API_KEY"],
        }))

    def on_message(ws, message):
        msg = json.loads(message)
        print(msg.get("type") or msg.get("channel"), msg)

    ws = websocket.WebSocketApp(
        "wss://v5.oddspapi.io/ws",
        on_open=on_open,
        on_message=on_message,
    )
    ws.run_forever()
    ```
  </Tab>
</Tabs>

## 2) Minimal login

```json theme={null}
{
  "type": "login",
  "apiKey": "YOUR_API_KEY"
}
```
