@ademilson_assuncao known interceptor bug (#29471), URL match on api.openai.com so nothing your side will fix it. quick unblock is a tiny cloudflare worker proxy, point the HTTP Request node at it:
export default { async fetch(req) { const u = new URL(req.url); u.host = 'api.openai.com'; return fetch(new Request(u, req)); } }
Hey @ademilson_assuncao, welcome to the community! Really thorough first post with all the details, makes it much easier to help.
Just to add a bit more context on top of what was shared above:
This is a confirmed bug (GitHub issue #29471) in n8n 2.19.x, specifically in the axios request interceptor. When n8n detects a URL starting with api.openai.com, it rewrites the headers object, and that breaks the setContentType method. It affects the credential test, HTTP Request node, and AI nodes when they all point to OpenAI’s domain.
The quickest workarounds while waiting for the official fix:
Just save the credential anyway - the error shows on the credential test, but the credential itself often works fine in the actual workflow. When using the OpenAI node, pick your model “By ID” and type the model name manually (like gpt-4o or gpt-4o-mini).
If you’re self-hosted on Docker, pin to version 2.18.5 in your compose file until a patch drops.