I’m having an issue with the n8n OpenRouter Model node.
It was working perfectly fine until recently, but suddenly started failing.
I have not changed the API key, regenerated it, or modified the workflow. Everything was the same as before when it was working. I’ve tested a curl command with the same API key and it works.
If I use the OpenRouter Chat Community node it works. But with the model for the AI agent doesn’t work.
Is this an n8n-related issue or something on OpenRouter’s side?
What is the error message (if any)?
Authorization failed - please check your credentials
Incorrect API key provided: sk-or-v1*************************************************************0e1d.
You can find your API key at <https://platform.openai.com/account/api-keys>.
In the cmd logs I see the following errors for the same request:
Invalid URL
NodeApiError Invalid URL
Please share your workflow
Share the output returned by the last node
Authorization failed - please check your credentials
Incorrect API key provided: sk-or-v1*************************************************************0e1d.
You can find your API key at <https://platform.openai.com/account/api-keys>.
It could be because the credential you switch to has no base URL set or is using the wrong type (OpenAI instead of OpenRouter). Please check inside the credential and make sure the base URL is exactly OpenRouter and that your API key has no extra spaces. Also, after switching credentials, reselect the model in the node (and try without “:free” in the name) before saving.