HTTP Request node fails with “config.headers.setContentType is not a function” when calling api.openai.com
Describe the problem/error/question
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
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):
Operating system:
Hi @erezeloi
This is an issue which the n8n team is aware.
Keep a lookout for any update
achamm
May 12, 2026, 10:20am
4
@erezeloi this is the openai.com URL interceptor bug on Cloud 2.19.x, every path through n8n’s request helper hits it. only unblock right now is proxying through a Cloudflare Worker so the URL isn’t api.openai.com :
``
export default { async fetch(req) { const u = new URL(req.url); u.host = ‘api.openai.com ’; u.protocol = ‘https:’; return fetch(new Request(u, req)); } }
`
then point the HTTP node at https://yourworker.workers.dev/v1/ …`, auth header passes through fine.
@erezeloi Welcome to the community! You’re hitting a known bug on n8n Cloud 2.19.x that the team is actively working on.
While waiting for the fix, here’s a simpler workaround than the Cloudflare proxy if your use case allows it:
Use HTTP Request node with Header Auth instead of the OpenAI credential:
Add an HTTP Request node
Method: POST
URL: https://api.openai.com/v1/chat/completions
Authentication: Header Auth
Header Name: Authorization, Value: Bearer sk-YOUR-API-KEY
Body Content Type: JSON, with your payload
This bypasses the broken axios interceptor entirely and connects fine. The output JSON format is identical to what the OpenAI node returns. Once the official fix ships, you can swap back to the native credential.
Hope this unblocks you!