n8n openai api
In this article, we will be taking a look at how you can set up GPT 5 / OpenAI in N8N. This process should take under 10 minutes in total.
If you want to watch a video showcasing the same info we cover in the article, it is linked down below.
Also if you need any help setting up N8N automations for your business, I’m taking on customer.
To start we’re going to create a simple dataframe in python:
Updating N8N
Before starting, it is a good idea to upgrade your N8N version. You can do this inside your workspace settings.

Getting the OpenAI API
Next, you’ll need an OpenAI API key. Go to https://openai.com/
Login and go to API Platform. After go into your API Keys settings.
Note: You must have a valid payment method and fund your account to get this working!

Building a Basic Workflow
Let’s build this simple workflow down below.

We first want to drag in a Chat Trigger, we will be using this to prompt. After bring in an AI Agent.
We want to now add a Chat Model to the Ai Agent. Select the OpenAI Chat Model.
When you select model from list, you’ll see all the different GPT 5 options you can use. It’s best to utilize gpt-5, mini and nano.

We now have to connect to our OpenAI account. If you have done this in the past you’ll have saved credentials. Otherwise click the pencil Icon to the right.

In this popup, you’ll want to paste in the API key we grabbed earlier from the OpenAI website. If the credentials work, you will get a confirmation like the image below.
If you just created your account or API key, its not uncommon for it to not work right away. Give it 30 minutes to an hour.

The only other addition to the workflow above is the chat memory. It’s set to 10.
To test this out send a message in the bottom right chat. I’ll ask GPT-5 Mini to create some examples of moving a dictionary to a dataframe.

Other ways to use GPT 5 in N8N
In your AI Agent you can set a backup model.

You can also set up GPT-5 with an AI Agent Tool

Lastly, due to limitations with GPT-5. If you need near real time information, you’ll need to use a tool like Perplexity. You can check out our article on Perplexity in N8N here.
Final Thoughts
It’s quite easy to setup OpenAI in N8N. Hopefully this tutorial was able to help you out. Thank you for checking our this article and check out our other N8N content.