WebSocket

Real-time communication with agents.

Connect to WebSocket

get
/v1/ws

Establishes a real-time WebSocket connection for interactive conversations.

Connection URL: wss://kex-websocket-worker.rough-math-4c20.workers.dev/v1/ws?key=your_api_key

Authentication: Use your API key as the key query parameter.

Message Flow:

  1. Send start_conversation to initialize chat context

  2. Send send_message to communicate with the agent (costs 1 Credit per message)

  3. Receive real-time responses from the agent

Authorizations
Query parameters
keystringRequired

Your API key for authentication

Example: kex_dev_...
Responses
101

WebSocket connection established successfully

application/json
get
/v1/ws
GET /v1/ws?key=kex_dev_... HTTP/1.1
Host: api.kex.gg
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "type": "connected",
  "message": "WebSocket connection established"
}