# How to stream response in javascript?

**URL:** <https://community.openai.com/t/how-to-stream-response-in-javascript/7310>\
**Category:** API\
**Created:** [August 6, 2021, 7:35pm UTC](https://community.openai.com/t/how-to-stream-response-in-javascript/7310 "2021-08-06T19:35:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![asabet](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/asabet/32/6448_2.png) [@asabet](https://community.openai.com/u/asabet)\
**Post date:** [August 7, 2021, 3:59am UTC](https://community.openai.com/t/how-to-stream-response-in-javascript/7310/2 "2021-08-07T03:59:30Z")

</div>

Turns out you have to stuff the payload into the url, ie `https://api.openai.com/v1/engines/curie/completions/browser_stream?prompt='Once upon a time'&max_tokens=3`

---

_[View the full topic](https://community.openai.com/t/how-to-stream-response-in-javascript/7310)._
