n8n - 💡(How to fix) Fix OpenAI credential fails in n8n Cloud: config.headers.setContentType is not a function or OpenAI native credential bug in n8n Cloud 2.19.x 2.20.x 2.21.x

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error message:

RAW_BUFFERClick to expand / collapse

Bug Description

Previously my workspace was on n8n.cloud 2.17.7 and OpenAI nodes were working. After the recent Cloud update, the native OpenAI credential fails with:

config.headers.setContentType is not a function

The same OpenAI API key works via curl and HTTP Request node, so this looks like a regression in the native OpenAI credential.

<img width="1440" height="900" alt="Image" src="https://github.com/user-attachments/assets/d99be0d3-43d0-4a00-bf20-de159c8dedf1" />

To Reproduce

Create new OpenAI credential

Expected behavior

The native OpenAI credential should connect successfully when a valid OpenAI API key is provided.

The same API key works correctly via curl to https://api.openai.com/v1/models and also works inside n8n using an HTTP Request node to https://api.openai.com/v1/responses.

The OpenAI credential test should not fail with config.headers.setContentType is not a function. It should validate the API key and allow the native OpenAI nodes to load models and execute normally.

Debug Info

n8n Cloud workspace: https://synychka2.app.n8n.cloud

n8n version: 2.19.x

Node / credential affected: Native OpenAI credential / OpenAI node

Error message: config.headers.setContentType is not a function

OpenAI credential settings tested: API Key: valid project API key Base URL: https://api.openai.com/v1 Organization ID: empty

What I tested:

  1. The same OpenAI API key works via Mac Terminal: curl https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"

  2. The same OpenAI API key works inside n8n using HTTP Request node: POST https://api.openai.com/v1/responses

  3. Only the native OpenAI credential test fails.

Result: This does not look like an OpenAI API key, billing, or quota issue. It looks like a native OpenAI credential regression in n8n Cloud.

Additional note: My workspace previously worked on n8n Cloud 2.17.7. The issue appeared after the Cloud update.

Operating System

mac OS

n8n Version

2.20.X + 2.21.0

Node.js Version

Unknown (n8n Cloud managed environment)

Database

SQLite (default)

Execution mode

main (default)

Hosting

n8n cloud

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The native OpenAI credential should connect successfully when a valid OpenAI API key is provided.

The same API key works correctly via curl to https://api.openai.com/v1/models and also works inside n8n using an HTTP Request node to https://api.openai.com/v1/responses.

The OpenAI credential test should not fail with config.headers.setContentType is not a function. It should validate the API key and allow the native OpenAI nodes to load models and execute normally.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING