- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.3k
Open
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
The detail parameter was marked as required in the TypeScript interface despite the comment indicating it has a default value of 'auto'. When the detail is omitted from the code, the openai api perform as expected but IDE will always flag detail as required (typescript). From all the examples provided on openai documentation pages, detail is optional. ChatGPT example is also reflecting what is on OpenAI documentation page.
I have created two PRs on this:
- [The first PR solved the] (fix: make detail parameter optional in ResponseInputImage interface fix: make detail parameter optional in ResponseInputImage interface #1575)
- better documentation on this: add vision example using image URL docs: add vision example using image URL #1571
To Reproduce
Copy and paste this in the IDE, the input will throw type error which
import OpenAI from "openai";
const client = new OpenAI();
const response = await client.responses.create({
    model: "gpt-5",
    input: [
        {
            role: "user",
            content: [
                {
                    type: "input_text",
                    text: "What is in this image?",
                },
                {
                    type: "input_image",
                    image_url: "https://openai-documentation.vercel.app/images/cat_and_otter.png",
                },
            ],
        },
    ],
});
console.log(response.output_text);Code snippets
OS
MacOS
Node version
Node.js v18.20.8
Library version
"openai": "^6.7.0"
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working