---
title: "Get chat WebSocket authentication"
method: GET
path: "/v2/rta/chat"
tags: ["rta"]
---

# Get chat WebSocket authentication

`GET /v2/rta/chat`

Returns an authentication token for establishing a WebSocket connection to Xbox Live's Chat service.

## What is Xbox Chat WebSocket?

The Chat WebSocket provides real-time messaging capabilities, allowing you to:
- Receive instant message notifications
- Send messages in real-time
- Get typing indicators
- Receive read receipts

## WebSocket Connection

```javascript
const response = await fetch('https://api.xbl.io/v2/rta/chat', {
  headers: { 'X-Authorization': 'YOUR_API_KEY' }
});
const authToken = await response.json();

const socket = new WebSocket(
  `wss://chat.xboxlive.com/users/xuid(${yourXuid})/chat/connect?AuthKey=${authToken}`,
  'chat'
);

socket.onmessage = (event) => {
  const message = JSON.parse(event.data);
  console.log('New message:', message);
};
```

## Use Cases

- **Real-time chat applications** - Build instant messaging features
- **Notification systems** - Alert users to new messages
- **Chat bots** - Respond to messages automatically

## Response `200`

Chat authentication token

- ApiResponse — Standard API response wrapper. All endpoints return responses in this format.
  - `content` unknown, required
  - `code` integer, required — HTTP status code from the upstream API. Common values: 200 (success), 400 (bad request), 401 (unauthorized), 404 (not found), 410 (deprecated/gone), 429 (rate limited), 500 (server error)

## Other responses

- `401` — Invalid or missing API key
- `429` — Rate limit exceeded

---

[API](https://skmtc.dev/xbl/apis/openxbl-api.md) · [All operations](https://skmtc.dev/xbl/apis/openxbl-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/xbl/openxbl-api/revisions/e5df7bdca559/schema)
