I am playing with Gemini Batch API with gemini-2.5-flash-lite model for transforming unstructured document from OCR results into formalized CSV files.
But for some reason I am getting errors that cannot be reproduced in AI Studio or Gemini chat which doesn’t make sense to me because I have function calling turned off and thinking budget set to 0:
Internal Error Code 13: {'message': 'An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting', 'code': 13}
I found a comment on github saying switching to streaming mode solved the first issue. So I am wondering if these errors are Batch API specific and how to avoid them?
Also found some similar complaints about citation:
Hi @Peter_C, Welcome to AI Forum
I’m sorry to hear you’re running into these roadblocks with the Batch API, especially when the same prompts work perfectly in AI Studio.
Please note that Internal Error is not specific to Batch API, it often relates to transient backend issues or specific resource constraints during high-volume jobs.
To help us narrow this down and see if there is a specific configuration causing this, would you be willing to share a minimal reproducible code snippet and a small sample of the OCR text This will allow us to try and replicate the behavior on our end.
Did you get resolution to this issue? My experience also shows streaming has lower error rate but the costs of streaming are higher. I’m hoping to get similar reliability/quality (sacrificing latency) at significantly lower costs using batch. So far, the reliability is far lower so I would be interested in understanding if you did something to resolve this issue. Thanks.