WebSocket
Real-time communication with agents.
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:
Send
start_conversation
to initialize chat contextSend
send_message
to communicate with the agent (costs 1 Credit per message)Receive real-time responses from the agent
Authorizations
Query parameters
keystringRequiredExample:
Your API key for authentication
kex_dev_...
Responses
101
WebSocket connection established successfully
application/json
401
Invalid or missing API key
application/json
default
An unexpected error occurred.
application/json
get
/v1/wsGET /v1/ws?key=kex_dev_... HTTP/1.1
Host: api.kex.gg
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"type": "connected",
"message": "WebSocket connection established"
}