# How to handle batch API limit?

**URL:** <https://community.openai.com/t/how-to-handle-batch-api-limit/722249>\
**Category:** API\
**Tags:** batch\
**Created:** [April 19, 2024, 11:42am UTC](https://community.openai.com/t/how-to-handle-batch-api-limit/722249 "2024-04-19T11:42:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![infokani](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/infokani/32/146378_2.png) [@infokani](https://community.openai.com/u/infokani)\
**Post date:** [April 19, 2024, 11:42am UTC](https://community.openai.com/t/how-to-handle-batch-api-limit/722249/1 "2024-04-19T11:42:44Z")

</div>

BatchError(code=‘token\_limit\_exceeded’, line=None, message='Enqueued token limit reached for gpt-3.5-turbo-0125 in organization …

---

<div class="post-metadata">

**Author:** ![mm-khalil1](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/mm-khalil1/32/355128_2.png) [@mm-khalil1](https://community.openai.com/u/mm-khalil1)\
**Post date:** [April 28, 2024, 12:00pm UTC](https://community.openai.com/t/how-to-handle-batch-api-limit/722249/2 "2024-04-28T12:00:26Z")

</div>

One solution is to split the jsonl file that holds the prompts into multiple files, where each file doesn’t exceed max TPD, and batch these files one by one.

---

<div class="post-metadata">

**Author:** ![sri.harsha](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@sri.harsha](https://community.openai.com/u/sri.harsha)\
**Post date:** [May 5, 2024, 4:13pm UTC](https://community.openai.com/t/how-to-handle-batch-api-limit/722249/3 "2024-05-05T16:13:06Z")

</div>

Hi,  
I’m getting the same error. Is the token limit just for content in the messages part or do we have to consider, custom-id, model, and type for the token limit as well?

I have 1350000 limit for gpt-4-turbo. But every file I upload gives enqueue token limit reached

---

<div class="post-metadata">

**Author:** ![Bamba](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/bamba/32/147557_2.png) [@Bamba](https://community.openai.com/u/Bamba)\
**Post date:** [May 11, 2024, 1:59pm UTC](https://community.openai.com/t/how-to-handle-batch-api-limit/722249/4 "2024-05-11T13:59:40Z")

</div>

I am very confident that this is a bug on OpenAI’s side. It undermines the main selling point of “batch processing”.

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [May 11, 2024, 2:11pm UTC](https://community.openai.com/t/how-to-handle-batch-api-limit/722249/5 "2024-05-11T14:11:40Z")

</div>

There’s a new limit in the docs: 50k lines per file.
