Need some assistance around websockets on open ai api

I dont find any articles/ documentation around usage of web sockets to connect to Open AI API.

I have specific use case where I would need real time communication between client and server.

I believe web sockets would be ideal for this type of problem but I don’t find the documentation around it.

ChatGPT does gives some URL reference on the documentation that takes to documentation around regular HTTP end point.

Any leads?

Hey @Srinivasjay. Welcome to the community!
AFAIK, web socket communication is not enabled: only standard HTTP requests.

What is your use case? Why do you believe that you need web sockets? If it’s related to streaming, you can actually stream the responses via HTTP as well :slight_smile:


Thanks for quick response @AgusPG . That’s good to know. I think its good for now to stream via HTTP. :slight_smile: It was just about the docs out of curiosity as chat GPT did respond in creating a web socket communication :slight_smile:


I just finished from node package works as a wrapper for the OpenAI API using sockets-io :wink:

available on github /mymusaid/openai-socket or yarn add