Error with OpenRouter Node: “Cannot read properties of undefined (reading ‘message’)”

Hi all,

I’m encountering a recurring error when using the OpenRouter node in n8n. The error message I receive is:

Cannot read properties of undefined (reading 'message')

This happens consistently when I try to run the node, even with minimal input. From what I can tell, the error seems to originate when the node attempts to access a response message that doesn’t exist or is not properly returned from the OpenRouter API.

Has anyone else experienced this issue? Could it be due to an unexpected response format, or is there something missing in my node configuration (like missing authentication, empty inputs, or malformed JSON)?

Any help or workaround would be appreciated. Let me know if I should share the full workflow or response data for further context.

Thanks!

Information on my n8n setup

  • n8n version: 1.90.2
  • Database (default: SQLite): SQLLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Caddy Docker
  • Operating system: Ubuntu Self Hosted
1 Like

I’ve actually run into a very similar problem myself.

A quick question: Are you trying to use one of the free models on OpenRouter?

I experienced this exact kind of error when I was using their free models. The problem went away completely once I switched to using a paid model .

It might be worth testing with a paid model to see if that resolves the issue for you. It’s possible the free models have different behavior or limitations that lead to this.