Welcome to Portkey Forum

Updated 3 months ago

Uploading Large Images Through Portkey

Hi, I am facing an issue while uploading an image through portkey. So right now I am trying to pass two different image one image is 90 KB and another image is 790 KB. Whenever I pass 90 KB image, I am getting the response successfully but Whenever I pass 790 KB image I am getting the above error.

I tried both of these image in anthropic console and its working there. One issue can happen is that I am using the online base 64 image encoder maybe it could be causing the issue but again I am also encoding 90 KB image there and it is working.(https://www.base64-image.de/)
Attachments
teahub.io-nature-road-wallpaper-2742751.jpg
Screenshot_2024-10-04_at_8.01.10_AM.png
Beauty_and_Style_Image.jpg
H
V
9 comments
according to anthropic API, I could technically send image up to one hundred MB on the api
Hi @Het007 thanks for pointing this out. I can confirm that this is happening. Though, this only looks to be frontend issue, because if try to send the same base6e image through code, it should generate a successful response.

We'll check and make a fix so that it doesn't break on the front end as well
Hi @Vrushank | Portkey Yes this image is working in api but there is another issue in api
This image has a size of 1.4 MB but whenever i pass it in api i get this error

"message": "{"error":{"message":"anthropic error: messages.0.content.1.image.source.base64: image exceeds 5 MB maximum: 5247744 bytes > 5242880 bytes","type":"invalid_request_error","param":null,"code":null},"provider":"anthropic"}",
Attachment
66fbe7828f0fd78ec622c3c2.jpg
from the error message it looks like anthropic error but same image on anthropic dashboard is working without any issue
Yeah, maybe Anthorpic dashboard converts the jpg to jpeg and then encodes it. They have this requirement that the image should only be JPEG, PNG, GIF, or WebP. If you convert your image above to jpeg, it should work
Attachment
CleanShot_2024-10-04_at_11.24.582x.png
I can confirm that converting the above image to jpeg works with Anthropic
Oh okay thanks. Let me try it
Add a reply
Sign up and join the conversation on Discord