n8n - 💡(How to fix) Fix OpenAI credential test fails: config.headers.setContentType is not a function

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

Describe the problem/error/question

What is the error message (if any)?

Using the OpenAI node with "My own credential" selected. The error appears in the credential setup screen when hitting Retry or saving. Tried creating multiple credentials (OpenAI account 1, 2, 3, 4) - all fail with the same error.

  • error: all
RAW_BUFFERClick to expand / collapse

Describe the problem/error/question

When trying to set up an OpenAI credential in n8n, the connection test fails immediately. This happens with every new credential I create. The issue persists after clearing browser cache and re-logging in.

What is the error message (if any)?

config.headers.setContentType is not a function

Please share your workflow/screenshots/recording

Using the OpenAI node with "My own credential" selected. The error appears in the credential setup screen when hitting Retry or saving. Tried creating multiple credentials (OpenAI account 1, 2, 3, 4) - all fail with the same error.

Share the output returned by the last node

N/A - workflow cannot execute due to credential failure.

Debug info

core

  • n8nVersion: 2.19.4
  • platform: docker (cloud)
  • nodeJsVersion: 24.14.1
  • nodeEnv: production
  • database: sqlite
  • executionMode: regular
  • license: enterprise (sandbox)

storage

  • success: all
  • error: all
  • manual: true
  • binaryMode: filesystem

client

  • userAgent: mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36
  • isTouchDevice: false
  • Generated at: 2026-05-07T15:31:15.924Z

API key is valid - confirmed $5 credit balance in OpenAI account.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING