Making a project on openai
i have Money inside, creating api key in the correct place.
getting error when trying to connect the api :
Couldn’t connect with these settings
config.headers.setContentType is not a function
Making a project on openai
i have Money inside, creating api key in the correct place.
getting error when trying to connect the api :
Couldn’t connect with these settings
config.headers.setContentType is not a function
welcome to the n8n community @Yagel_Shitrit
I would first confirm that you are running the latest stable n8n version, restart the instance, then recreate the OpenAI credential and test it again.
Hi, i did everything already. still isnt working.
I’ve seen someone with the same problem, but he didn’t get an answer. Maybe there’s anything else I can do?
@Yagel_Shitrit
True, I found this issue as well: GitHub issue #29471. It was opened last week and matches the same type error. If you are using n8n Cloud, this will likely require an update/fix from the n8n support team. If you are self-hosted, I would temporarily test with another OpenAI-compatible provider/base URL if your workflow allows it, just to confirm the issue is isolated to the current OpenAI integration path.
the official support/contact guide is here: Where to get help | n8n Docs
The docs explain which support channels are available depending on your plan, including forum support, email support, and what information you should include when contacting the team. For Cloud users, they also recommend copying the debug information from Help → About n8n → Copy debug information before opening a support request.
Im on the latest, tried what you told me on dm, still the same ![]()
Your OpenAI API key is fine, don’t worry this config.headers.setContentType is not a function error is usually caused by an outdated or incompatible n8n/OpenAI node version, so update n8n, recreate the OpenAI credentials, and use the official OpenAI node from n8n with the base URL set to https://api.openai.com/v1
@Yagel_Shitrit Welcome to the community
This likely isn’t your OpenAI project or API key.
config.headers.setContentType is not a function looks like an n8n-side bug/regression in some recent versions, and others are reporting the same OpenAI credential error. OpenAI project keys are created per project, so if the key is from the right project and billing is active, that part is probably fine.
Try:
update n8n to the latest version
recreate the OpenAI credential
use Base URL: https://api.openai.com/v1
leave Organization ID empty unless needed
if still failing, use HTTP Request node temporarily or report it to n8n support
I’m experiencing the exact same issue. On the latest stable and beta versions, the OpenAi API key does not work, but I have another instance on a previous version and the API key works as expected.
I can only assume that something is broken with the “Latest Stable” and “Latest Beta”.
"Couldn’t connect with these settings
config.headers.setContentType is not a function"
@Yagel_Shitrit @dcarter You’re both hitting the same confirmed bug in n8n Cloud on recent versions (2.19.x) where the axios interceptor throws config.headers.setContentType is not a function when calling OpenAI’s endpoints.
The n8n team is aware and working on a fix. In the meantime, the most reliable workaround:
Use HTTP Request node with Header Auth directly:
https://api.openai.com/v1/chat/completionsAuthorization, Value: Bearer YOUR-API-KEYThis bypasses the credential system entirely. The response JSON is identical to the OpenAI node output.
@dcarter the fact that it works on your older instance confirms it’s a version-specific regression, not an API key issue. Once the fix ships you can switch back to the native credential.