n8n is a powerful workflow automation tool that lets you connect various services and applications — without writing any code.
With n8n, you can automate tasks, integrate APIs, and even work with artificial intelligence.
Previously, we explained how to install n8n Community Edition on a VPS — if you don’t yet have a running n8n instance, start with that guide.
In this tutorial, we’ll walk through how to connect OpenAI to n8n so you can use language models (such as ChatGPT) in your automation workflows.
Step 1. Open the Credentials Section
Log in to your n8n dashboard.
In the left-hand menu, find Credentials.
Click Add new credential.
Step 2. Choose OpenAI
In the list of available credential types, search for OpenAI.
Select it and click Continue.
Step 3. Get Your OpenAI API Key
To allow n8n to interact with OpenAI, you’ll need an API key.
Go to platform.openai.com.
Log into your account (or create one if you don’t have it yet).
Navigate to the API Keys section.
Click Create new secret key.
Give your key a name (for example, tutorial) and link it to a project if needed.
Copy the generated key.
⚠️ Important: You’ll only see the key once at creation time — save it somewhere safe!
Step 4. Configure OpenAI in n8n
Go back to n8n, to the OpenAI credential setup window.
Paste your copied API key into the corresponding field.
The Organization ID field can be left empty (it’s optional).
The Base URL field is usually left as the default value.
Click Save.
If everything was configured correctly, you’ll see a green message: Connection tested successfully.
You can now use this credential in any OpenAI node inside n8n.
Step 5. Use OpenAI in a Workflow
After you’ve added your key:
- Open or create a new workflow.
- Add an
OpenAInode. - In the node’s settings, select the credential you created earlier.
Now you can automate tasks such as:
Теперь вы можете автоматизировать:
- Text generation
- Summarization
- Query processing
- Integration with other services
In just a few steps, you’ve connected n8n + OpenAI — a powerful combo that lets you bring AI capabilities into your workflows and automate repetitive tasks.
To ensure your automation runs smoothly, you’ll need a reliable server.
Our company provides:
Start automating today — order a VPS in Europe and create your first smart workflow with n8n + OpenAI!


Comments