The nodejs example from your docs says base image, masking layer, then prompt. However if you try running this you'll run into an error. After testing I found the masking later goes after the prompt, but the documentation says otherwise. API is definitely a little buggy.
https://platform.openai.com/docs/api-reference/images/create-edit
From your docs - does not work out of the box like this
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const response = await openai.createImageEdit(
fs.createReadStream("otter.png"),
fs.createReadStream("mask.png"),
"A cute baby sea otter wearing a beret",
2,
"1024x1024"
);
An API for accessing new AI models developed by OpenAI