# V4 TypeScript / Node SDK for OpenAI API

**URL:** <https://community.openai.com/t/v4-typescript-node-sdk-for-openai-api/323681>\
**Category:** Announcements\
**Tags:** api\
**Created:** [August 16, 2023, 6:11pm UTC](https://community.openai.com/t/v4-typescript-node-sdk-for-openai-api/323681 "2023-08-16T18:11:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![logankilpatrick](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/logankilpatrick/32/14116_2.png) [@logankilpatrick](https://community.openai.com/u/logankilpatrick)\
**Post date:** [August 16, 2023, 6:11pm UTC](https://community.openai.com/t/v4-typescript-node-sdk-for-openai-api/323681/1 "2023-08-16T18:11:24Z")

</div>

We’re excited to announce a major new version of our TypeScript/Node SDK for the OpenAI API!

Version 4 offers a huge set of improvements – some of the highlights include:

- Streaming responses for chat & completions
- Carefully crafted TypeScript types
- Support for ESM, Vercel edge functions, Cloudflare workers, Deno
- Better file upload API for Whisper, fine-tune files, DALL·E images
- Improved error handling through automatic retries & error classes
- Increased performance via TCP connection reuse
- Simpler initialization logic

If you’ve used a previous version of our SDK, check out the [migration guide](https://github.com/openai/openai-node/discussions/217).

Otherwise, you can get started today by running `npm i openai`

 ![sdk-7](https://us1.discourse-cdn.com/openai1/original/3X/0/2/02e26b3b7b8f72d1a7ee775f3260ec1f27c84217.png)

NPM: [openai - npm](https://www.npmjs.com/package/openai)

Github: [GitHub - openai/openai-node: Node.js library for the OpenAI API](https://github.com/openai/openai-node)

---

<div class="post-metadata">

**Author:** ![Innovatix](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/innovatix/32/193579_2.png) [@Innovatix](https://community.openai.com/u/Innovatix)\
**Post date:** [September 7, 2023, 10:50am UTC](https://community.openai.com/t/v4-typescript-node-sdk-for-openai-api/323681/3 "2023-09-07T10:50:49Z")

</div>

That’s Great thanks for sharing @logankilpatrick

---

<div class="post-metadata">

**Author:** ![damir.secki](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/damir.secki/32/77530_2.png) [@damir.secki](https://community.openai.com/u/damir.secki)\
**Post date:** [October 6, 2023, 12:15pm UTC](https://community.openai.com/t/v4-typescript-node-sdk-for-openai-api/323681/4 "2023-10-06T12:15:54Z")

</div>

Just realised that… 1,5 months later… no emails nor nothing to the consumers… Not very developer friendly…

Secondly, most of the API references are not updated, the examples are as minimum as possible… would really help if we could get more solid examples… with proper error handlings, (addressing no funds, busy server etc errors)… and especially, how to address streaming… the example provided is not acceptable…

I am paying every month for the service, quite a lot… and would expect the support and documentation to be at least decent!

Could you please provide the example in streaming… what would be a good practice to make a production ready API proxy… with the ability to ABORT (terminate the generation) at any time, like in chatGPT?

I don’t think is too much to ask

---

<div class="post-metadata">

**Author:** ![Bitcoin](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/bitcoin/32/48126_2.png) [@Bitcoin](https://community.openai.com/u/Bitcoin)\
**Post date:** [October 18, 2023, 12:19am UTC](https://community.openai.com/t/v4-typescript-node-sdk-for-openai-api/323681/5 "2023-10-18T00:19:41Z")

</div>

> [@damir.secki](#):
>
> that… 1,5 months later… no emails nor nothing to the consumers… Not very dev

You can always star the Github repository or fork and pull from upstream.

[https://github.com/openai/openai-node](https://github.com/openai/openai-node)

---

<div class="post-metadata">

**Author:** ![EricGT](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/ericgt/32/20571_2.png) [@EricGT](https://community.openai.com/u/EricGT)\
**Post date:** [December 27, 2023, 1:17pm UTC](https://community.openai.com/t/v4-typescript-node-sdk-for-openai-api/323681/6 "2023-12-27T13:17:22Z")

</div>

Closed on December 27, 2023, 1:17pm UTC


