---
title: "Chat agent that runs any model through OpenRouter"
kind: "Kit"
category: "Developer"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/c43634fb-4f94-4ed3-b7e8-7affb5750e71"
updated: "2026-11-12"
---

# Chat agent that runs any model through OpenRouter

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n chat agent whose model is a text setting. It sends each message through OpenRouter to the model you name, from any maker on its list, and keeps the last few messages of each chat.

Chat agent that runs any model through OpenRouter is an n8n workflow in the Developer category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n chat agent has a model that is only a line of text. You type a message in the chat, and the agent answers with whichever model you named in one node. The call goes through OpenRouter, which fronts models from many makers, so switching is a matter of changing that line. A simple memory keeps the last messages of each chat. Five nodes run it, beside three sticky notes.

### Who it suits

Builders who want to compare models on the same chat, and small teams who need to change models without rebuilding a workflow. Skip it if you want one fixed provider with no extra account, since every call here passes through OpenRouter.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Automation | n8n builders | Try several models in the same chat before choosing one | A builder asks one question and then swaps the model line to compare answers. |
| Product | Product teams | Test which model suits a support or writing flow | A team checks three cheap models on the same ten questions. |
| Research | Analysts | Reach a model that no other node offers | An analyst calls a newly released model by its ID. |
| Teaching | Trainers | Show how model choice changes an answer | A trainer runs one prompt on a small and a large model. |

You need a little n8n: import a file, add one credential with a changed base URL and press the chat button.

### Where to use it

Any n8n that can reach OpenRouter will run it. The chat works inside n8n, and you can make it public for other people.

- n8n Cloud: import the file into a new workflow there
- Your own n8n server: the same file and steps
- A chat page: switch on the trigger’s public chat to share the address

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. You need an OpenRouter key and one credential.

What you need first

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own |
| OpenRouter | An account and an API key |
| A credential | An OpenAI API credential with the OpenRouter key and the base URL \`https://openrouter.ai/api/v1\` |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Add an OpenAI API credential. Put your OpenRouter key in the key field and set the base URL to `https://openrouter.ai/api/v1`.
3. Select that credential in `LLM Model`.
4. Open `Settings` and check the `model` value, an OpenRouter model ID.
5. Press the Chat button and send a message.

### How to use it

Chat as you like. To change the model, edit the `model` value in `Settings` and send another message. The agent keeps the last 5 messages of each chat.

What to change for a different result

| To change | Where |
| --- | --- |
| The model | The \`model\` value in \`Settings\` |
| How much the chat remembers | \`Context Window Length\` in \`Chat Memory\` |
| The agent’s behaviour | A system message in \`AI Agent\`, under Options |
| A public chat | Make Chat Publicly Available in the trigger |

### Example

A builder sends the message “Summarize the plot of Hamlet in two sentences.” With `deepseek/deepseek-v4-flash` in `Settings`, the agent answers from that model.

Changing the value to `google/gemini-3.8-flash` and sending the same message gives a second answer from another maker, with the earlier messages of the chat still in the memory.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. An agent is a node that asks a chat model to answer and can use memory and tools. OpenRouter is a service with one address and many models behind it.

**For experts.** `Settings` copies `chatInput` into `prompt` and the chat’s `sessionId`, and `LLM Model` reads its `model` from `{{ $json.model }}`. `Chat Memory` uses the custom key `{{ $json.sessionId }}`, and its context window is left at the default, 5.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Settings\` | Sets \`model\`, \`prompt\` and \`sessionId\` | The one place to pick the model |
| \`LLM Model\` | The OpenAI Chat Model node, version 1.1 | Its credential points at OpenRouter |
| \`AI Agent\` | Answers the prompt, version 1.7 | No tools are connected |
| \`Chat Memory\` | Simple Memory, version 1.3 | Kept in n8n’s own process |

### Good to know

Model IDs change often, and the file’s default model was gone.

- Default model: the file’s \`deepseek/deepseek-r1-distill-llama-8b\` and the other four example IDs are no longer on OpenRouter’s public model list, read on 12 November 2026. Mindket’s copy uses \`deepseek/deepseek-v4-flash\` and lists six IDs that are
- Check IDs: a withdrawn ID makes OpenRouter refuse the call. See \`https://openrouter.ai/models\` first
- Newer n8n: it has a dedicated OpenRouter Chat Model node, which suits a new build. This copy also runs on older versions
- Memory: it is lost on a restart and does not suit a setup with several workers
- Public chat: anyone who finds the address can spend your OpenRouter credit
- Billing: OpenRouter bills by the price of the model you choose, for each message and the history sent with it
- Your data: messages and history go to OpenRouter, which passes them to the company that runs the model
- Credentials: the JSON holds none

## README

```markdown
# Chat agent that runs any model through OpenRouter

An n8n chat agent whose language model is a setting. You type a message in the chat, and the agent answers with whichever model
you named in one node. The model call goes through OpenRouter, which fronts models from many companies, so you can switch from
one maker's model to another by changing a single line of text. The agent keeps the last few messages of each chat.

## What is inside

- `workflow.json`: the workflow as n8n exports it, eight nodes. Five of them run and three are sticky notes. It holds no
  credential.
- `README.md`: these notes.

## What we changed from the original copy

- The default model in `Settings` was `deepseek/deepseek-r1-distill-llama-8b`. OpenRouter's public model list, read on 12 November
  2026, no longer holds it. The default is `deepseek/deepseek-v4-flash` now, which the list does hold.
- The sticky note of model examples named five models that the same list no longer holds. It names six that it does: `openai/gpt-6-luna`,
  `google/gemini-3.8-flash`, `deepseek/deepseek-v4-flash`, `mistralai/mistral-small-2603`, `qwen/qwen3.8-flash` and
  `google/gemma-4-26b-a4b-it:free`.
- The credential link and the chat webhook ID are gone, and the file's name is ours.
- Nothing else. The agent, the memory and the model node are as the file had them.

## Before you start

- An n8n instance, on n8n Cloud or your own server.
- An OpenRouter account and API key.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Add a credential of the type OpenAI API. Put your OpenRouter key in the key field, and set the base URL to
   `https://openrouter.ai/api/v1`. Name it something like OpenRouter.
3. Select that credential in `LLM Model`.
4. Open `Settings` and check the `model` value. It is an OpenRouter model ID, such as `deepseek/deepseek-v4-flash`.
5. Press the Chat button and send a message.

## How a run goes

1. `When chat message received` starts a run for each message and passes on the text as `chatInput`, with a `sessionId`.
2. `Settings` sets three fields: `model`, which holds the model ID, `prompt`, which copies the message, and `sessionId`, which
   copies the chat's session ID.
3. `AI Agent` (version 1.7) takes `{{ $json.prompt }}` as its prompt, with the prompt type set to define.
4. `LLM Model` is the OpenAI Chat Model node, version 1.1. Its `model` field reads `{{ $json.model }}` from `Settings`, and its
   credential points at OpenRouter, so the call goes there.
5. `Chat Memory` is a Simple Memory node, version 1.3. It uses the custom key `{{ $json.sessionId }}`, so each chat keeps its own
   history. Its context window length is left at the default, 5.

## Change the look

- The model: the `model` value in `Settings`, or the `model` field of `LLM Model` directly.
- How much the chat remembers: `Context Window Length` in `Chat Memory`.
- The agent's behaviour: add a system message in `AI Agent`, under Options.
- Tools: connect them to `AI Agent`. The model you pick must support tool calls.
- A chat page for other people: switch on Make Chat Publicly Available in `When chat message received`.

## Good to know

- Model IDs change often. If a model is withdrawn, OpenRouter refuses the call. Check the list at `https://openrouter.ai/models`
  before you rely on an ID.
- Newer n8n versions have a dedicated OpenRouter Chat Model node, as n8n's source showed on 12 November 2026. This copy uses the
  OpenAI Chat Model node with an OpenRouter address, which also runs on older versions.
- The memory is kept in n8n's own process. It is gone after a restart, and it does not suit a setup that runs several workers.
- A public chat lets anyone who finds its address spend your OpenRouter credit.
- IDs that end in `:free` carry no price in the model list. They change often, so check one before you rely on it.
- Where the data goes: each message and the chat history go to OpenRouter, which passes them on to the company that runs the model
  you chose.
- Billing: OpenRouter charges by the price of the model you choose, for the tokens of each message and of the history sent with it.
```

## What is in it

3 files, 9 KB, downloaded as a zip.

```text
NOTICE.md  596 B
README.md  4 KB
workflow.json  4 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: 3 steps, starting on a chat message
- AI: 1 step calls an AI model: AI Agent
- Sign-ins: Signs in to: OpenAI
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 3 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/c43634fb-4f94-4ed3-b7e8-7affb5750e71)
- [Its page on Mindket](https://mindket.com/p/c43634fb-4f94-4ed3-b7e8-7affb5750e71)
