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
- How to Build a WhatsApp AI Chatbot with n8n: What to Know First
- How to Extract Data from Text with AI in n8n (Names, Dates, Amounts)
- How to Control AI Costs in n8n Workflows
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