How to restart failed batch jobs, or delete batch jobs?

I have a lot of batch jobs, some fail due to token limits.

I want to check them and restart them or delete them. Doesn’t look like the batch API has a delete method?

Or a way to restart?

1 Like

Hi and welcome to the Forum!

You can’t delete or restart a batch per se.

If your batch jobs fail due to token limits, you’d have to make adjustments to the JSONL file containing your individual requests. As you can’t edit a new file once uploaded, you need to make the updates locally, then upload a new file and reference it when creating a new batch job with a new ID.

2 Likes

Hi there. My individual batch files are under the limit. I’m able to run ~10 of them or so, but I want to run 100 batch jobs in 24 hours.

So imagine 10 succeed and 90 fail. My list of batch jobs is growing hugely so even calling client.batches.list() takes a few seconds.

This doesn’t seem like a scalable solution for more than a few days unless I can manage the jobs better.

Well, are your jobs failing because you hit the batch queue limit for your usage tier or because your requests are exceeding the available context window for the model you are using?

Either way, if I was in your shoes I’d try to identify the cause and then re-design the approach for the submission of batch jobs.

Of course, if the issue is due to rate limits you also have the option to add more funds to your account in order to move towards a higher tier with higher rate limits.

Failing because of batch queue limits.

Now I have hundreds of failed batches and just listing them all is slow. It’s a requirement to list them in order to associate an input file to a batch job.

There should be a way to delete batch jobs so I can fix the mistakes and make the code performant again.

2 Likes

Do you have a way to reach out to the OpenAI developers? Their retention policy ( https://platform.openai.com/docs/models/tts#default-usage-policies-by-endpoint ) says “until deleted by customer” for /v1/batches so aside from the inconvenience of not having a delete option, it’s also creating a legal and policy issue that needs to be addressed.