Error sending image to OpenAI: APIError: 413 The data value transmitted exceeds the capacity limit

I’m trying to send an image from my Firebase Storage bucket to openai edit image API, but I’m getting the error above on the title.

The “fileBuffer” has a length of 0.1MB and according to the API docs the image must have less than 4MB.

I tried to pass other small images too, but had no success.

I gave permissions on Firebase to anyone writes and reads the storage.

I don’t know why I’m getting this error. Has anyone had the same problem?

2 Likes

Running in the same issue right now, did you find a solution in the end?

Hello

I have a link of the image, so I convert it into a buffer then pass it to the images.edit function and I am still getting then 413 error. The input image is of type png and its size is less than 1 Mb… Is there any solution or a workaround?

Welcome @madhumita.chatne

The image editing works only when there’s an image to be edited as well as a mask indicating which areas should be replaced.

Additionally it only supports DALL-E-2 model.