You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: TypeError: Header name must be a valid HTTP token ["openaı-organization"] on Turkish Windows/Locale #1928
Confirm this is a Node library issue and not an underlying OpenAI API issue
This is an issue with the Node library
Describe the bug
Bug Description
The SDK throws a fatal error Header name must be a valid HTTP token ["openaı-organization"] on systems running with a Turkish OS locale (e.g., Windows set to Turkish language).
When the internal Stainless API engine passes header keys like "OpenAI-Organization" or "OpenAI-Project", JavaScript's standard .toLowerCase() on a Turkish locale converts the uppercase I to a dotless ı, turning the keys into "openaı-organization" and "openaı-project". Since ı is a non-ASCII character, the underlying Node.js network layer (undici/http) fails validation and terminates the process.
Temporary Workaround (Proven to Work)
As a temporary hotfix, manually modifying the packaged bundle (e.g., extension.js in IDE extensions) and changing the literal definitions from camelCase to strict lowercase entirely prevents this bug:
Change "OpenAI-Organization" to "openai-organization"
Change "OpenAI-Project" to "openai-project"
By declaring them lowercase from the start, we bypass the need for runtime normalization which triggers the Turkish I-problem.
Suggested Official Fix
To ensure locale-invariant header normalization, replace the standard .toLowerCase() with a locale-safe conversion in headers.ts:
constlowerName=name.toLocaleLowerCase('en-US');
To Reproduce
Set the operating system language/locale to Turkish (tr-TR).
Install the openai-node library.
Attempt to initialize the client and make an API request using a third-party proxy provider (e.g., OpenRouter) that passes through header builders.
The system throws a fatal token validation error due to "openaı-organization".
Code snippets
OS
Windows (with Turkish locale / tr-TR)
Node version
Managed internally by Continue IDE extension
Library version
Latest version bundled inside Continue IDE extension
Activity
anishesg commentedon Jun 8, 2026
Took a look, #1930 should address it.
fix(internal): lowercase header names with locale-pinned `en-US` rule