Guides · Cost and speed

Choosing the AI model in n8n: OpenAI, Anthropic, Gemini or OpenRouter

Updated 2026-12-02

Short answer: in n8n, the model behind an AI Agent or LLM chain node is a separate chat model sub-node (OpenAI, Anthropic, Google Gemini, OpenRouter and others), each with its own credential and a model field. To try another model you swap the sub-node or change the model name. OpenRouter gives you models from many labs with one key. Before switching a live workflow, run the new model on 30–50 inputs the workflow really receives.

How the model is set

Check n8n's docs for the full current list: new chat model nodes are added regularly.

OpenAI node or OpenRouter?

A lab's own node (OpenAI, Anthropic, Gemini)OpenRouter Chat Model
ModelsThat lab'sMany labs and open models
Keys and billingOne account per labOne account, one balance
Trying another labNew account, new credential, swap the nodeChange the model name
Lab-specific featuresFullMost common features; check the model page

Switch models without breaking the workflow

  1. Collect test inputs: from past executions, copy 30–50 real inputs the AI node received (the email, the form, the ticket), anonymized.
  2. Write down what the next node needs: a field in the JSON, one of three labels, under 500 characters. Those are your checks. More in build a test set.
  3. Run the current model and the candidate on the same inputs. A copy of the workflow fed by a sheet or table of test inputs is enough. Recent n8n versions also have a built-in evaluations feature for this: see n8n's docs.
  4. Compare pass rate, cost (from the token usage each execution shows) and time. The comparison method.
  5. Switch in the live workflow, and keep the copy for the next test.

The thing that breaks most often in a workflow is the format: a model that wraps JSON in extra text, renames a field or adds a label you didn't list. The next node fails, or worse, quietly writes the wrong value. Check format first.

Which model is best for n8n?

The one that passes your workflow's checks at the lowest cost. Classification and extraction usually run fine on the cheap models (from $0.17 per 1,000 runs in our pricing comparison); open-ended writing and multi-step agents often need a bigger one. And if your workflow uses GPT-4o, GPT-4o mini or GPT-4.1, it has to move anyway: they shut down in the API on January 14, 2027.

Let every new model take your test, automatically

Modeldrop (in development) keeps your prompts and your rules for a correct answer. Every time a major lab releases a model, it runs your prompts on it, compares the results with the model you use today and emails you the verdict: how many pass, what it would cost at your volume and how fast it is. No API keys, no eval code.

See the founding offer

Related guides