Using open router for chat models

I’m having some trouble using open router as a chat option for the any ai chains since there isn’t specifically for open router, and when I try using a http request I can never seem to get the auth header to register correctly. anyone have any ideas on how to fix this?

Information on your n8n setup

  • **n8n version:**1.36.4
  • Database (default: SQLite):
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):**own,main
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):**docker
  • **Operating system:**Ubuntu 22.04
1 Like

Welcome to the community @yessir :tada::clap:

Could you share your workflow (by pasting in the workflow json) or screenshots especially around how you’re sending the http request with the HTTP node?

Hi @yessir !

Here is a simple workflow that makes use of an HTTP Request to access one of the LLMs available through OpenRouter:

Simply replace the values in the Set module and you have your first start with OpenRouter!

Comon guys! OpenRouter is 100% compatible with OpenAI API Rest structure

I don’t want to use HTTP request as I lose “streaming” response functionality

A very simple is to implement this in OpenAI credentials where base URL by default points to openai otherwise we can use another endpoint and load openrouter models

1 Like

Ok I got weak :slight_smile:

n8n has been pivotal over many companies I worked in as CTO and thought a small token of appreciation would be a PR to add OpenRouter :rocket:

1 Like

@TheKore thanks for your Collaboration and your PR
personally I’m just amazed by OpenRouter
they propose a multiple LLM,
they even propose to filter which LLM to data collection
image

1 Like

I would love to see this!!

Try this solution: How to Integrate OpenRouter in your N8N Workflows

3 Likes

I tried that at first, but some models dont work and return [ERROR: Cannot read properties of undefined (reading 'text')], like Claude 3.

I added credits to my account and its working now.

It would be essential for n8n to have native OpenRouter support.

3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.