# Node for GPT-3 Open AI

**URL:** https://discourse.nodered.org/t/node-for-gpt-3-open-ai/67759
**Category:** Developing Nodes
**Created:** [15 September 2022 17:46 UTC](https://discourse.nodered.org/t/node-for-gpt-3-open-ai/67759 "2022-09-15T17:46:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Triark](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/triark/32/58932_2.png) [@Triark](https://discourse.nodered.org/u/Triark)
#### Post date: [15 September 2022 17:46 UTC](https://discourse.nodered.org/t/node-for-gpt-3-open-ai/67759/1 "2022-09-15T17:46:02Z")

</div>

Hello everyone,

I am trying to use Open AI on Node Red:  
I have not found any available Node.  
I have seen that OpenAI has an official Node.js library, and Python also:  
[https://beta.openai.com/docs/api-reference/introduction#searches/create-file](https://beta.openai.com/docs/api-reference/introduction#searches/create-file)

You are the experts in Node Red, would it be interesting to create a new Node to use it directly in Node Red?  
Or do you suggest using it with HTTP POST?

I don't know how to create nodes, I'm just starting in Node Red 😉

Thks

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [16 September 2022 03:52 UTC](https://discourse.nodered.org/t/node-for-gpt-3-open-ai/67759/2 "2022-09-16T03:52:23Z")

</div>

If you set:

```auto
    /** Allow the Function node to load additional npm modules directly */
    functionExternalModules: true,

```

in settings.js (restart node-red), you can use the "setup" tab in a function node, it will import the nodejs library directly for use within the function node.

---

<div class="post-metadata">

### Author: ![Triark](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/triark/32/58932_2.png) [@Triark](https://discourse.nodered.org/u/Triark)
#### Post date: [16 September 2022 18:13 UTC](https://discourse.nodered.org/t/node-for-gpt-3-open-ai/67759/3 "2022-09-16T18:13:20Z")

</div>

Thank you for your help @bakman2 😉

I´m novice with Node Red...  
I followed your instructions and right now is allow Externals Modules in Function Node.

How I can transfer or pass the parameters to this nodejs openai module in the Function Module?  
I did not understand well, how should I use it? 😕

Could you help me with an example?

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [28 September 2022 10:58 UTC](https://discourse.nodered.org/t/node-for-gpt-3-open-ai/67759/4 "2022-09-28T10:58:59Z")

</div>

> [@Triark](#):
>
> You are the experts in Node Red, would it be interesting to create a new Node to use it directly in Node Red?  
> Or do you suggest using it with HTTP POST?

I would use HTTP POST.  
Following page specifies how to construct such a HTTP POST request:

- [https://beta.openai.com/docs/api-reference/completions](https://beta.openai.com/docs/api-reference/completions)

---

<div class="post-metadata">

### Author: ![Triark](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/triark/32/58932_2.png) [@Triark](https://discourse.nodered.org/u/Triark)
#### Post date: [2 October 2022 22:13 UTC](https://discourse.nodered.org/t/node-for-gpt-3-open-ai/67759/5 "2022-10-02T22:13:33Z")

</div>

Thank you @janvda

That's exactly what I'm doing...it was the easiest option! 😉

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [16 October 2022 22:14 UTC](https://discourse.nodered.org/t/node-for-gpt-3-open-ai/67759/6 "2022-10-16T22:14:07Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
