Request payload size exceeds the limit: 50000 bytes

I keep hitting this error via the API: Request payload size exceeds the limit: 50000 bytes.

It’s strange because when I use the exact same file in the AI studio the token count is about 17,000 (far below the 1M limit).

Tried both 1.5 and 2.0 models.

Any ideas?

1 Like

Hi,

Welcome to the forum.

Consider to use the File API for larger files and pass in the resulting URL to your API request.