WebSocket Protocol Reference
Complete specification for WebSocket message types.
Client → Server
auth
Authenticate the connection:
{ "type": "auth", "token": "wyl_sk_..."}generate (Sync)
Submit generation request:
{ "type": "generate", "modality": "image", "family": "flux", "model": "dev", "task": "t2i", "format": "1024", "prompt": "description", "stream_frames": true}subscribe (Async)
Subscribe to job events:
{ "type": "subscribe", "job_id": "j_abc123"}unsubscribe (Async)
Unsubscribe from job:
{ "type": "unsubscribe", "job_id": "j_abc123"}cancel (Async)
Cancel running job:
{ "type": "cancel", "job_id": "j_abc123"}Server → Client
authenticated
Auth successful:
{ "type": "authenticated", "user_id": "usr_xyz"}error
Error occurred:
{ "type": "error", "code": "invalid_token", "message": "Authentication failed"}frame (Sync)
Progressive frame:
{ "type": "frame", "step": 15, "total_steps": 25, "data": "base64_jpeg..."}complete
Generation complete:
{ "type": "complete", "output": "https://cdn.render.weyl.ai/i/xyz.webp"}Connection Limits
- Max connections per API key: 10
- Idle timeout: 5 minutes
- Max message size: 10 MB