GPT-4 API. Is "openai" NPM package updated for this?

I just got accepted into the GPT-4 API beta. Has the official “openai” NPM package for Node.js been updated to be able to call the brand new GPT-4 API endpoint? If not, where do I find sample code or a library that does that for me or shows me how to do that, or do I have code my own from scratch?

Also, is this the API endpoint for ChatGPT-4 to? Or is that still not available yet?

It connects just like the other Chat endpoints…so, you’ll want to read about the new Chat endpoint if you haven’t yet. I think the node.js might be updated for Chat endpoint… if it is, you should just need to swap the model…

Hope this helps!

2 Likes

That’s the thing. I’m having trouble finding docs on the new endpoint. So far all I found was the summary page with the blurbs about the different models. Nothing specific on how to craft a payload to the GPT-4 endpoint and what to expect back.

@robert.oschler The docs were recently updated. Here’s what you’re looking for.

Essentially, you can interact with GPT-4 like you would with gpt-3.5-turbo.

4 Likes

Thanks. If I craft a prompt in ChatGPT Plus, can I expect it to generate similar results if I use it with the GPT-4 API? If not, do you know what kind of variances I will encounter and if there are any steps I can (multiple calls, etc.) to get the same results I am getting using the prompt in ChatGPT Plus.

The results could be somewhat similar, but they could just as well be vastly different. OpenAI has shown that GPT-4 does outperform GPT 3.5 (ChatGPT) in many ways.

You could test the differences quickly using the Chat mode in OpenAI’s playground. Or you could program it too, but that might take a bit longer depending on your level of familiarity.

The comparison would be between ChatGPT and GPT-4 API, not 3.5 API. Does that make a difference? Or you saying “in general” that one can never expect the API and chat-based products to be in alignment?