HTTP Request Node gets 405 error on Docker for Windows, but curl from another container works

"Hello,
I am running a self-hosted n8n instance (version 1.107.4) on Docker for Windows.
I am trying to make a POST request to the OpenRouter API (https://openrouter.ai/api/v1/images/generations) using the HTTP Request node, but it consistently fails with a 405 Method Not Allowed error.
I have already done extensive troubleshooting and have confirmed:
It is not a network proxy issue.
It is not a DNS filtering issue.
It is not a Windows Firewall issue (I have added exceptions).
Crucially, I can successfully run the exact same API call using curl from a separate container on the same Docker host. This command works without a 405 error:
docker run --rm curlimages/curl -X POST https://openrouter.ai/api/v1/images/generations -H “Authorization: Bearer API_KEY” -H “Content-Type: application/json” -d “{"prompt":"a test from docker","model":"playgroundai/playground-v2.5-1024px-aesthetic"}”

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

{
“errorMessage”: “Method not allowed - please check you are using the right HTTP method”,
“errorDescription”: “405 - ""”,
“errorDetails”: {
“rawErrorMessage”: [
“405 - ""”
],
“httpCode”: “405”
},
“n8nDetails”: {
“nodeName”: “HTTP Request”,
“nodeType”: “n8n-nodes-base.httpRequest”,
“nodeVersion”: 4.2,
“itemIndex”: 0,
“time”: “8/29/2025, 12:59:37 AM”,
“n8nVersion”: “1.107.4 (Self Hosted)”,
“binaryDataMode”: “default”,
“stackTrace”: [
“NodeApiError: Method not allowed - please check you are using the right HTTP method”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts:780:15)“,
" at processTicksAndRejections (node:internal/process/task_queues:105:5)”,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_0c275070fd0434c00ffd62213b2bcae4/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1212:9)“,
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_0c275070fd0434c00ffd62213b2bcae4/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1582:27”,
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_0c275070fd0434c00ffd62213b2bcae4/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2158:11"
]
}
}

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker Desktop
  • Operating system: Windows 11

This test proves that my host machine and Docker networking are configured correctly, and the issue seems to be specific to the n8n HTTP Request node or its container environment. Can you please help me figure out why n8n is failing when a direct curl from Docker works?"

Hey @Varad_Deshpande hope all is good.

I wasn’t able to find any references to “https://openrouter.ai/api/v1/images/generations” in the openrouter’s documentation. Could you please point me in the right direction? Can you also help me find “playground-v2.5-1024px-aesthetic” model on openrouter’s page with models?

As far as my understand goes I believe ,
https://openrouter.ai/api/v1/images/generations this URL is used as a base URL for any openrouter model for image generation!

I would love to take a look at the documentation where you took this url from. Otherwise if this is something LLM of your choice told you, rethink how much trust you put in it :slight_smile:

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