Batch: The custom_id for this request is a duplicate of another request

I’m getting the following error, when trying to create a new batch from the recent batch endpoint.

The custom_id for this request is a duplicate of another request. The custom_id parameter must be unique for each request in a batch.

This is a new batch, from a new file, that it contains some custom_ids, used in a previous batch request. Because of this error, I updated all custom_ids to "new-{custom_id}", but still get the same error.

Hi - I have just tried to reproduce the error. The issue is most likely that within a given batch you use the same custom_ID for two requests or more. In the error message it should tell you the line(s) where you have the duplicate ID(s).

In other words, every request input object that you submit as part of a given batch must have a unique custom_ID. Across batches you can use the same custom_IDs and but not within a given batch.

I hope that makes sense.

2 Likes

Yes, you are right. I found an error in my code, that was generating duplicates in my sample.
Thanks!

1 Like