Unpredictable Error 400 Codes

I am new to this forum and the GPT-4-Vision-Preview API, but I have a lot of experience with the regular GPT-3.5-Turbo and Davinci API’s since I’ve been building with them for the past year.

I have started my latest project which is a uploader to YouTube via Selenium, and I want to use the GPT-4-Vision API. So, I followed the OpenAI Cookbook Tutorial by Kai Chen, and it was working well. It sends the first 60 frames in base64 as a png, but sometimes I get an error 400 from the API. I use opencv to get the frames and put them in base64, with the png algorithm. Now, I don’t understand why I am getting an error. It can’t be because of image type, but I also don’t believe it can be over 20mb. And the really weird part is that sometimes when I rerun on the exact same video, I don’t get the error.

Unfortunately, I can’t put links here or the code, but I will say I am following the ‘Processing and narrating a video with GPT’s visual capabilities and the TTS API’ by Kai Chen exactly, just instead of base64 jpg, I am using base64 png.

Any help is appreciated. Thanks in advance, everyone!

1 Like

Hey, welcome to the forum.

Being so new and bleeding edge tech, it can and does randomly fail at times. Best thing to do is handle those cases and report back to your user for them to try again.

As time goes on, the network will improve. I think Azure has a lot more resources, though they tend to lag a bit behind on what’s available, I think?

Hope this helps.

1 Like

I cannot say for sure without knowing the details of the 400 error, but is it possible that you have reached the rate limit?