
11/19/2024 · Catarina Pires Mota, Gabriel Massadas
What this post added
Introduced a WebSocket API for AI Gateway, enabling persistent, real-time communication with AI providers. Implemented authentication using Cloudflare API tokens via `cf-aig-authorization` header and `sec-websocket-protocol` for browser compatibility. Leveraged Durable Objects for message handling and introduced the `eventId` field in the Universal format to correlate asynchronous messages in streaming scenarios.