How to Use OpenAI, Gemini or Claude Models in n8n

n8n works with several model providers. The steps are similar for all.

Choose a provider

Options include OpenAI, Google Gemini and Anthropic Claude, among others. Compare quality for your task, price, speed and data policies. Features and prices change, so check each provider’s current page.

Get an API key

Create an account with the provider, generate a key and set spending limits if available.

Add credentials in n8n

Create a credential for the provider and select it in the model node. Never paste keys into prompts or code.

Use the model

Attach the model node to an AI Agent or a Basic LLM Chain node. Write a clear prompt and test it.

Settings that matter

  • Temperature: lower for consistent answers, higher for creative ones.
  • Max length: limit output to control cost.

Keep it safe

Do not send sensitive personal data unless the provider’s terms allow it and you have a reason. See controlling costs.

Next

Extracting data from text is a practical first use.

Quick answers

Which model is best?

It depends on your task, cost and data needs, so test a few.

Where do I put the API key?

In n8n credentials.

What does temperature do?

Lower values give steadier answers and higher values more varied ones.


Related reading

Ready to turn n8n into a real skill?

Join a practical, trainer-led n8n course with projects like lead capture, notification flows, an AI step and a tool-using agent. Ask for a free counselling call to see if it fits your goal.

See the 15-day n8n training  |  Find your city  |  Book free counselling

Want to learn n8n hands-on?

Join our 15-day live, trainer-led n8n training.

Book Free Counselling
WhatsApp Call Enquiry

Request A Callback

Talk To Our Expert

We use your details only to contact you about this training.