Hi everyone,
I’m having an issue connecting my OpenAI credentials in n8n Cloud.
n8n version: 2.19.3
Credential: OpenAI account
Base URL: https://api.openai.com/v1
Organization ID: empty
Custom headers: disabled
OpenAI billing: active
API key: newly created, with All permissions, inside the correct project
When I try to save/test the credential, n8n shows:
config.headers.setContentType is not a function
This does not seem to be an OpenAI API key or billing issue, because the error happens inside n8n before the request is completed.
I found a similar report mentioning that requests to api.openai.com may fail in n8n 2.19.x because config.headers is being rewritten as a plain object, and then setContentType is not available.
Is there any workaround for n8n Cloud users, or does my instance need to be updated/fixed by n8n support?
Thanks!
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:
Sounds similar to this thread
Hey guys, I can’t connect my OpenAI credential on my n8n platform, but before it was working well. Why ? I created a new account yesterday and the problem happened like this.
I already made those 3 solutions :
Create a new secret key
Add more $ on my OpenAI wallet
Turn on all permissions on OpenAI Platform
Here is the problem
[Capture d'écran 2026-05-06 112641]
Information on your n8n setup
n8n version: 2.19.2
Running n8n via (Docker, npm, n8n cloud, desktop app): VPS Hostinger
Operating…
same here.im stock with this,trying to debug this for about 4 hours and still same result
Temporary solution, if you don’t need to the latest features, you can downgrade to 2.18.5, still works here
Sal1
May 7, 2026, 10:02am
6
The same problem with n8n running via localhost n8n = 2.19.4
If your intention is to create an AI chatbot, you may want to try this workaround that I’ve described in this thread.
Vinicius_Adam_Moraes:
Hi everyone,
I’m having an issue connecting my OpenAI credentials in n8n Cloud.
n8n version: 2.19.3
Credential: OpenAI account
Base URL: https://api.openai.com/v1
Organization ID: empty
Custom headers: disabled
OpenAI billing: active
API key: newly created, with All permissions, inside the correct project
When I try to save/test the credential, n8n shows:
config.headers.setContentType is not a function
This does not seem to be an OpenAI API key or billing issue, because the error happens inside n8n before the request is completed.
I found a similar report mentioning that requests to api.openai.com may fail in n8n 2.19.x because config.headers is being rewritten as a plain object, and then setContentType is not available.
Is there any workaround for n8n Cloud users, or does my instance need to be updated/fixed by n8n support?
Thanks!
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:
welcome to the n8n community @Vinicius_Adam_Moraes
opened 10:11AM - 29 Apr 26 UTC
team:nodes
status:in-linear
status:team-assigned
### Bug Description
The HTTP Request node throws NodeApiError: config.headers.s… etContentType is not a function when the request URL starts with https://api.openai.com/. The error originates inside the global axios request interceptor in `packages/core/src/execution-engine/node-execution-context/utils/request-helpers/axios-config.ts` at line 30:
```
if (config.data === undefined) {
config.headers.setContentType(false, false);
}
```
The interceptor assumes config.headers is an AxiosHeaders instance, but applyVendorHeaders (lines 39–46 in the same file) reassigns config.headers to a plain object literal whenever the URL targets OpenAI:
```
config.headers = {
...Container.get(AiConfig).openAiDefaultHeaders,
...(config.headers ?? {}),
};
```
Plain objects don't expose setContentType, so any downstream invocation of the interceptor on that mutated config (including the path triggered by the V3 HTTP Request node when sending no body) raises the TypeError, which is caught and rewrapped as NodeApiError at `HttpRequestV3.node.js:588`.
### To Reproduce
1. Create a workflow with an HTTP Request node (typeVersion 4.2).
2. Set:
- Method: GET
- URL: https://api.openai.com/v1/models
- Authentication: None
- Send Headers: true, with Authorization: Bearer <key> and OpenAI-Organization: <org> (I think this second header may be optional for reproducibility).
3. Execute the workflow.
4. The node fails with NodeApiError: config.headers.setContentType is not a function.
A minimal workflow JSON that reproduces the issue (single "Get models" node hitting https://api.openai.com/v1/models) is enough; no credentials are required because the failure happens before the request leaves the instance.
### Expected behavior
The HTTP Request node should successfully reach https://api.openai.com/v1/models (or whichever OpenAI endpoint), receive the response from OpenAI, and surface it as the node output. The interceptor should not throw, regardless of whether applyVendorHeaders rewrites the headers as a plain object or an AxiosHeaders instance.
### Debug Info
# Debug info
## core
- n8nVersion: 2.19.0
- platform: docker (self-hosted)
- nodeJsVersion: 22.21.0
- nodeEnv: production
- database: postgres
- executionMode: scaling (single-main)
- concurrency: 60
## storage
- success: all
- error: all
- progress: false
- manual: false
- binaryMode: filesystem
## pruning
- enabled: true
- maxAge: 336 hours
- maxCount: 5000 executions
## security
- blockFileAccessToN8nFiles: false
Generated at: 2026-04-29T10:07:45.227Z
### Operating System
N/A
### n8n Version
2.19.0
### Node.js Version
22.21.0
### Database
PostgreSQL
### Execution mode
queue
### Hosting
self hosted
its a know issue
Since you are on n8n Cloud, I would open a support ticket and include your workspace URL, n8n version, the exact error, and the GitHub issue reference n8n-io/n8n#29471. I would not rotate the key again unless support asks for it.