I am facing a major issue with Batch API and getting this error:
Cannot find file <file_id>, or project <project_id> does not have access to it.
Can someone PLEASE help me. Been stuck here for the past 10 days and we have dependency on Batch API ![]()
This issue started on 19th August and is still persistent(from past 10 days)
I have verified that my API key and project configuration are correct.
This is the response I get from OpenAI Batch API:
{
"id": "batch_<batch_id>",
"model": null,
"usage": {
"input_tokens": 0,
"total_tokens": 0,
"output_tokens": 0
},
"errors": {
"data": [{
"code": "invalid_request",
"line": null,
"param": "<file_id>",
"message": "Cannot find file <generated_file_id>, or project <project_id> does not have access to it."}]}....... rest of the response
}
API Endpoint: /v1/responses
I also tried to isolate whether this is related to the Batch API itself by uploading a new file and immediately trying to retrieve it:(Ruby Code below)
client = OpenAI::Client.new(access_token: "OPENAI_API_KEY")
file = client.files.upload(
parameters: {
file: "test.jsonl",
purpose: "batch"
})
file_id = file["id"]
puts "Created: #{file_id}"
retrieved = client.files.retrieve(id: file_id)
puts "Retrieved: #{retrieved}"
The upload succeeds and returns a new file ID, but retrieving that newly created file immediately fails with a 404:
No such File object: <file_id>. Faraday::ResourceNotFound: the server responded with status 404 (Faraday::ResourceNotFound)
This makes me suspect that the issue is with the Batch API from Open AI’s side, since the newly uploaded file cannot even be retrieved immediately afterward.