Cloudflare Enablement
Workers
Workers
Edit this page on GitHub
Set theme to dark (⇧+D)

Stream OpenAI API Responses

Use the OpenAI v4 SDK to stream responses from OpenAI.

In order to run this code, you must install the OpenAI SDK by running npm i openai.