AI Gateway OpenAI Realtime Connection Error

Hello. When I'm trying to connect in realtime to OpenAI Realtime with AIGateway (for metrics, costs, etc...), it gives me an error, the following example is running on node so I can make sure the limitations of the cloudflare worker doesn't interfere with the demostration:
const url = `wss://gateway.ai.cloudflare.com/v1/${ACCOUNT}/${GATEWAY}/openai?model=gpt-4o-realtime-preview-2024-12-17`;
const ws = new WebSocket(url, {
headers: {
"cf-aig-authorization": "Bearer " + AIG,
Authorization: "Bearer " + OPENAI,
"OpenAI-Beta": "realtime=v1",
},
});
const url = `wss://gateway.ai.cloudflare.com/v1/${ACCOUNT}/${GATEWAY}/openai?model=gpt-4o-realtime-preview-2024-12-17`;
const ws = new WebSocket(url, {
headers: {
"cf-aig-authorization": "Bearer " + AIG,
Authorization: "Bearer " + OPENAI,
"OpenAI-Beta": "realtime=v1",
},
});
This gives me the following error: error: Error: Unexpected server response: 500 This error 500 is shown also in cloudflare workers environment (with protocols instead of headers), is AI Gateway bugged or down for realtime?. When i try to connect without AI Gateway it works. Does anyone knows whats happening?. Thank you.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?