Skip to main content
WebSockets provide real-time updates without polling. Get instant notifications when jobs complete, inputs are ready, or errors occur.

Connection

Connect to the WebSocket endpoint with your API key:

Python SDK

Event Types

Subscribe to specific events or use wildcards:

Wait for Job

Convenience function to wait for a specific job:

With Progress Callbacks

Protocol Reference

Connection Flow

  1. Connect with API key in query string
  2. Receive connected message with session ID
  3. Send subscribe to register for events
  4. Receive subscribed confirmation
  5. Receive event messages as they occur
  6. Send ping periodically to keep connection alive

Message Formats

Subscribe:
Event:
Ping/Pong:

Auto-Reconnect

The Python SDK handles reconnection automatically:
Subscriptions are automatically restored after reconnection.

Error Handling

Raw WebSocket (No SDK)

Using any WebSocket client: