Can we use file uploads (e.g. file IDs) in batch requests to /v1/responses?

Hi all,

I’m using the new /v1/responses endpoint for classification tasks that typically take two file inputs:

  • A taxonomy file (PDF)
  • A project document (PDF.)

In the standard (non-batch) flow, I use client.responses.create(...) and pass both files using input_file objects along with the prompt — and this works perfectly.

Now I want to batch this logic using the /v1/responses batch endpoint. My batch requests look like this:
{
“custom_id”: “some-id”,
“method”: “POST”,
“url”: “/v1/responses”,
“body”: {
“model”: “gpt-4.1”,
“input”: [
{
“type”: “input_text”,
“text”: “Prompt with instructions”
},
{
“type”: “input_file”,
“file_id”: “file-abc123”
},
{
“type”: “input_file”,
“file_id”: “file-xyz456”
}
]
}
}
But I receive the following error:
Invalid value: ‘text’. Supported values are: ‘code_interpreter_call’, ‘function_call’, etc.

Some threads and helpers suggest file IDs might not be supported in batch mode and that file content must be inlined, but I haven’t found this confirmed in the official documentation. Could someone from the OpenAI team confirm:

  1. Are file uploads supported in batch requests to /v1/responses?
  2. Is there any limit to prompt length or total request size per line in the batch?

Thanks in advance!

You’ve formed the “Responses” endpoint input parameter incorrectly.

An array must be role messages of a chat, indicating the participant, from “system”, “user”, “assistant”. (Functions would be pointless).

input_file is only for PDFs.

Verify your RESTful call JSON independently results in success (not using the OpenAI SDKs).

As input, you’d have something like

[
  {
    "type": "message",
    "role": "developer",
    "content": [
      {
        "type": "input_text",
        "text": "You are Bob. Use provided PDFs as new knowledge to answer from."
      }
    ]
  },
  {
    "type": "message",
    "role": "user",
    "content": [
      {
        "type": "input_text",
        "text": "introduce yourself briefly"
      }
    ]
  }
]