I used Fern [4] to generate an SDK for the OpenAI API. It makes it a lot easier to stream responses! https://github.com/fern-openai/openai-node#streaming
There’s some other niceties of the Fern-generated SDK:
- Endpoints organized by resource, e.g. client.audio.transcribe(...)
- Properties are camelCase to match JS/TS convention (they are snake_case in OpenAI’s SDK)
- The file upload endpoints support Node.js ReadStream, rather than just File
[1] https://github.com/openai/openai-node
[2] https://github.com/openai/openai-node/issues?q=is%3Aissue+is...
[3] https://github.com/openai/openai-node#streaming-completions