What is the difference between File Inputs (Attachment) and File Search (Tool)?

I see two different methods in the docs for working with files using GPT-5:

1- Using the File Search tool with a vector store: https://platform.openai.com/docs/guides/tools-file-search. For example:

from openai import OpenAI
client = OpenAI()

response = client.responses.create(
    model="gpt-4.1",
    input="What is deep research by OpenAI?",
    tools=[{
        "type": "file_search",
        "vector_store_ids": ["<vector_store_id>"]
    }]
)
print(response)

2- Using File Inputs: https://platform.openai.com/docs/guides/pdf-files. For example:

from openai import OpenAI
client = OpenAI()

file = client.files.create(
    file=open("draconomicon.pdf", "rb"),
    purpose="user_data"
)

response = client.responses.create(
    model="gpt-5",
    input=[
        {
            "role": "user",
            "content": [
                {
                    "type": "input_file",
                    "file_id": file.id,
                },
                {
                    "type": "input_text",
                    "text": "What is the first dragon in the book?",
                },
            ]
        }
    ]
)

print(response.output_text)

My question is: what is the logical difference between approach #2 and approach #1?

More specifically:

  • Does approach #2 not use a vector store? Is it more like including the entire file directly in the context? What makes me think this is that approach #2 has a total upload limit of 32 MB and accepts only PDFs, whereas approach #1 uses a vector store and therefore doesn’t have that concern.

  • On the other hand, the first line on the page for approach #2 says:

OpenAI models with vision capabilities can also accept PDF files as input.

So is the reason approach #2 differs from approach #1 simply that it relies on vision capabilities, and therefore has the 32 MB limit?

You are correct, #2 doesn’t use a vector store. And a image version is also passed so that it can “see” the pdf images.

#1 being a vector search can save you token usage, but depending on the subject the semantic search might also not see the whole context. Vector store currently doesn’t support image search.

Thank you @aprendendo.next

Do you think ChatGPT (not API) ever uses approach #2?

Can’t say for sure as it is a closed product, but it seems the most probable. Vector store is a very specific use case, maybe they use it for the memory function (but again, it’s just a guess).

I think the exact opposite, meaning ChatGPT always uses approach #1 because we can upload files much larger than 32 MB to ChatGPT, and they don’t have to be only PDFs.

And in the test I did with ChatGPT 5 Instant model, I saw that the file_search tool was used in call requests in the chat where I uploaded 3 PDFs.

But we still can’t know for sure since it’s a closed product, as you mentioned.

Perhaps it changes dynamically depending on the file size or the paid plan (pro has a higher context window). Try asking it about an image in the PDF, that should help clarify.
Also, as it is a closed product, there might be tools that aren’t directly available in the API.

Makes sense. I tested this with a single-page PDF file that was 83kb (less than 32MB) in size, containing a paragraph about gorillas but featuring a picture of a dog.

The result was as follows:

So I don’t think approach #2 is available in ChatGPT Plus. Because if it were, this test would have been a good opportunity to use it.

When I tested Approach #2 with the API, it was able to read the image as expected. (I’ve used the same pdf)