Introduction
Let’s build a super-simple AI chatbot in n8n using only two nodes—Chat and AI Agent—and OpenRouter’s free-tier models (like llama3.1
or mixtral-small
). No coding required!
Prerequisites
- An OpenRouter account (free tier)
1. Get Your OpenRouter API Key
- Go to https://openrouter.ai and sign up.
- In your dashboard, click API Keys → Create Key.
- Copy the new key (it starts with
or-…
).
2. Add OpenRouter Credentials in n8n
- In n8n’s editor, click the gear ⚙️ icon in the top right → Credentials.
- Choose OpenRouter API.
- Paste your API key.
- Set Base URL to
https://openrouter.ai/api/v1
. - Save.
3. Build the Chatbot Workflow
A. Chat Trigger
- Drag in a Chat node.
This node both receives user text and displays the AI’s reply.
B. AI Agent
- Drag an AI Agent node and connect it after Chat.
- Select the same OpenRouter credentials.
- In Tasks, you can add quick actions like:
- Summarize
- Translate
- Extract keywords
- Link the Chat output (
text
) into the Agent’s Input field.
The AI Agent can enrich replies—for example, summarizing a longer user question.
4. Activate & Test
- Click Activate on each node.
- Open the Chat node’s URL in a browser (n8n shows it when you click the node).
- Type a message and hit send.
- Watch your AI reply instantly, powered by OpenRouter’s free model!
Conclusion
That’s it—two nodes, zero code, and you’ve got a Chatgpt like AI chatbot using n8n + OpenRouter’s free tier.
Want more step-by-step guides? Follow @soyoma.io and let’s build together!