Skip to content

Invalid file 'image': unsupported mimetype ('application/octet-stream'). Supported file formats are 'image/png'. #1468

Open
@ChiefGnome

Description

@ChiefGnome

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

Since yesterday, a call to the "openai.images.edit" API throws an error:
BadRequestError: 400 Invalid file 'image': unsupported mimetype ('application/octet-stream'). Supported file formats are 'image/png'.
The same API call worked for that last year without this error.

To Reproduce

  • Provide to images, and set the filenames to patchFn and maskFn, both files are PNGs.
  • Call the openai.images.edit API with the following code

Code snippets

const response = await openai.images.edit({
        image: fs.createReadStream(patchFn),
        prompt,
        mask: fs.createReadStream(maskFn),
        n: 1,
        size: "1024x1024",
        response_format: "b64_json",
    }
);

OS

macOS 15.4

Node version

Node v22.14.0

Library version

openai 4.95.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenai apiRelated to underlying OpenAI API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions