-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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
I am encountering TypeScript type issues with the OpenAI Node.js SDK version 4.88.0. The main issues are:
- Headers Type Mismatch:
Type '{ [x: string]: string; } | { append(name: string, value: string): void; delete(name: string): void; get(name: string): string; getSetCookie(): string[]; has(name: string): boolean; set(name: string, value: string): void; forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void; }' is not assignable to type 'Record<string, string>'.
Environment
- Node.js version: >=22.11.0
- TypeScript version: ^5.8.2
- OpenAI SDK version: 4.88.0
- NestJS version: 11.0.5
Additional Context
- I am using the SDK in a NestJS application
- The issues occur during the build process
- I have
skipLibCheck: true
in the tsconfig.json.
To Reproduce
Steps to Reproduce
- Create a new NestJS project
- Install OpenAI SDK v4.88.0
- Create a service that uses the OpenAI client
- Try to use the chat completions API with proper typing
Code snippets
private openAIClient = new OpenAI({ apiKey: process.env.OPENAI_API_KEY })
OS
macOS
Node version
v22.11.0
Library version
"openai": "^4.88.0"
big-mac-slice
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working