OpenAI Image Edit Help

const response = await openai.createImage(
    fs.createReadStream(path),
    fs.createReadStream("output.jpg"),
    1,
    "256x256"
)

I have this code, its a replica of what OpenAI shows for image editing. Both my images are under 4MB and I have provided a valid API key.

But, I get this error:
image

I’m not an expert in openai stuff, but the arguments seem wrong. From the docs, it looks like you just need a object that has the prompt, n, and size keys.
The createImageEdit() function seems to have similar arguments with what you’re doing

1 Like