---
title: "Does the OpenAI Batch API return results in the same order as the input file?"  
description: "Does the OpenAI Batch API return results in the same order as the input file?"  
author: "Magdalena Malinowska"  
published: 2026-10-26  
updated: 2026-10-26  
canonical: https://www.mindstick.com/forum/162954/does-the-openai-batch-api-return-results-in-the-same-order-as-the-input-file  
category: "OpenAI API"  
tags: ["OpenAI API", "Batch API", "JSONL"]  
reading_time: 1 minute  

---

# Does the OpenAI Batch API return results in the same order as the input file?

I’m preparing a Batch API job with many requests and need to match each result back to the record that created it. Are results written to the output file in the same order as the input JSONL, or should I rely on the `custom_id` field to match them?

If the order isn’t guaranteed, I’d also be interested in how people handle missing or failed records when processing the output. I’m mainly trying to make sure my import step doesn’t silently attach an answer to the wrong request.


---

Original Source: https://www.mindstick.com/forum/162954/does-the-openai-batch-api-return-results-in-the-same-order-as-the-input-file

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
