#CreateImageEdit() getting 400 response

1 messages · Page 1 of 1 (latest)

agile sand
#

I'm getting 400 on the createImageEdit.
API key is correct and request body is correctly written accordingly to docs. Image is even changed from RGB to RGBA format as one other developer from this community noticed.


  const configuration = new Configuration({
    apiKey: process.env.OPENAI_API_KEY,
  });
  const src = "./assets/generated.png";
  const mask = "./assets/mask.png";
  const openai = new OpenAIApi(configuration);

  try {
    const response = await openai.createImageEdit(
      createReadStream(src),
      createReadStream(mask),
      prompt,
      1,
      "512x512"
    );