<p>That is achieved usually via web-socket, however <a href="https://community.openai.com/t/need-some-assistance-around-websockets-on-open-ai-api/119851/2" rel="nofollow noreferrer">it is not available yet</a></p>
<p>I see some workaround like <a href="https://github.com/cookeem/chatgpt-service" rel="nofollow noreferrer">https://github.com/cookeem/chatgpt-service</a>, which just get's the full answer and then streams word by word via websocket, so it's even slower</p>

CC BY-SA 4.0
2023-10-03T13:05:31.083Z
Please, refrain from answering questions that are off-topic. Instead, you should vote to close them. Programming questions and questions about specific products, tools or APIs are generally off-topic here.
nbro
CC BY-SA 4.0
2023-09-26T23:50:02.110Z
2023-09-26T23:50:02.110Z
Alberto
<p>I am using the get_completion function to generate response to a question. Since generating response takes a long time (~5 seconds) I would like to display the response text as it's generated (dynamically, similar to chatgpt or <a href="https://www.perplexity.ai/" rel="nofollow noreferrer">https://www.perplexity.ai/</a>). Does openAI's API make this possible? I couldn't find a code/example anywhere online</p>

<open-ai><chatgpt><question-answering><text-generation>
Dynamic text completion
afshi7n
# Dynamic text completion

(Asked by: username_0 on 2023-09-26)

I am using the get\_completion function to generate response to a question. Since generating response takes a long time (~5 seconds) I would like to display the response text as it's generated (dynamically, similar to chatgpt or <https://www.perplexity.ai/>). Does openAI's API make this possible? I couldn't find a code/example anywhere online

**Tags:** open-ai, chatgpt, question-answering, text-generation


---

## 1 answers

### Answer by username_1 on 2023-09-26. Score: 1

That is achieved usually via web-socket, however [it is not available yet](https://community.openai.com/t/need-some-assistance-around-websockets-on-open-ai-api/119851/2)

I see some workaround like <https://github.com/cookeem/chatgpt-service>, which just get's the full answer and then streams word by word via websocket, so it's even slower

> **Comments:**
> **username_2**: Please, refrain from answering questions that are off-topic. Instead, you should vote to close them. Programming questions and questions about specific products, tools or APIs are generally off-topic here.  

---

