Connecting
How to establish and authenticate WebSocket connections, including regional endpoints, connection limits, and response formats.
Connection URL
wss://{region}.mmt.gg/api/v1/wsAvailable Regions:
eu-central-1.mmt.gg(Frankfurt)
Authentication
Authentication is required for all WebSocket connections. Include your API key as a query parameter:
| Parameter | Required | Description |
|---|---|---|
api_key | Yes | Your API key |
format | No | Response format: json (default) or cbor |
Security model: API keys are secret server-side credentials. Do not connect directly from browser/mobile clients with your real key. Use your backend to manage the upstream WebSocket connection and relay sanitized data downstream.
URL Examples
JSON format (default):
wss://eu-central-1.mmt.gg/api/v1/ws?api_key=YOUR_KEYCBOR format:
wss://eu-central-1.mmt.gg/api/v1/ws?api_key=YOUR_KEY&format=cborFrame Type by Format
format=json(default): server sends WebSocket text frames (JSON strings)format=cbor: server sends WebSocket binary frames (CBOR bytes)
Connection Limits
The maximum number of concurrent WebSocket connections depends on your subscription tier:
| Tier | Max Connections |
|---|---|
| Basic | 5 |
| Pro | 15 |
Connection Behavior
Successful Connection
When authentication succeeds and you have not exceeded your connection limit, the WebSocket connection is accepted. The server sends a connected message with your session information:
{
"type": "connected",
"tier": "pro",
"max_subscriptions": 100,
"format": "json"
}| Field | Type | Description |
|---|---|---|
type | string | Always "connected" |
tier | string | Your API tier (basic, pro) |
max_subscriptions | int | Maximum subscriptions allowed on this connection |
format | string | Response format (json or cbor) |
After receiving this message, you can begin subscribing to channels.
Failed Connection
Connections may be rejected for the following reasons:
| Reason | Behavior |
|---|---|
| Invalid API key | Connection rejected with error |
| Max connections exceeded | Connection rejected |
When a connection is rejected, the WebSocket handshake fails and you will not be able to establish a connection.
CORS
Direct browser usage is not a supported security model for secret API keys. If you are troubleshooting browser CORS/websocket issues, move the MMT connection to your backend and expose a backend endpoint/socket to your frontend instead.