Skip to content

Lesson 45 ยท Beyond Text

Files and Images with ChatGPT and Claude

Send images and PDFs to ChatGPT and Claude: how multimodal input works in the apps and APIs, what the models can miss, token costs and how to check answers.

ChatGPT and Claude are not limited to typed text. You can give them screenshots, photos and documents and ask questions about them. This is the multimodal idea in everyday use: different kinds of input are turned into representations that a model can process together.

It is convenient, and it creates a risk. A confident answer about a chart looks the same whether the model read the chart correctly or not.

In the apps

In both apps you can typically attach a file to a message or add it to a project, then ask about it. Which file types, sizes and counts are accepted depends on your plan and changes over time. For example, as of December 2026, OpenAI's help center lists a per-project file limit that differs between plans. Check the current help pages instead of relying on a number from memory.

A file added to a project is available as reference material for chats in that project. When a collection is large, an app may retrieve only relevant parts instead of reading everything for every message. Anthropic's help center says that on paid plans, large Claude project knowledge bases use retrieval. So "I uploaded it" does not prove that every page was read for your latest question.

In the APIs

Each API accepts a file as a part of a message, next to your text question. These fragments are read-only: they need a client object, an API key and a real file.

Python
# Read-only: OpenAI Responses API, file input by URL
response = client.responses.create(
    model="gpt-6.2-sol",
    input=[{
        "role": "user",
        "content": [
            {"type": "input_file", "file_url": "https://example.com/report.pdf"},
            {"type": "input_text", "text": "List the dates in this report with page numbers."},
        ],
    }],
)
Python
# Read-only: Claude Messages API, PDF input by URL
message = client.messages.create(
    model="claude-opus-5-5",
    max_tokens=4000,
    messages=[{
        "role": "user",
        "content": [
            {"type": "document", "source": {"type": "url", "url": "https://example.com/report.pdf"}},
            {"type": "text", "text": "List the dates in this report with page numbers."},
        ],
    }],
)

Both vendors also document inline (base64) data and previously uploaded file IDs. As of December 2026, their API documentation includes these points:

Topic OpenAI file inputs Claude PDF support
How a PDF is read Extracted text plus page images, on models that accept images Both text and visual content such as charts can be used
A documented limit Each file under 50 MB, and 50 MB combined per request Up to 600 pages per request (100 with a window under 1M tokens), within a request size limit
Office files Word and slide files are read as text only, without their embedded images and charts .docx and .xlsx are not accepted as document blocks; convert them first

Limits differ by platform and change, so read the current page before you design around them. The table is not a ranking: the two limits measure different things. If a chart in an office file matters, a PDF export may preserve it better than a text-only reading.

Files cost tokens

Pages and images take space in the context window and are billed as input tokens. The count depends on the vendor, the model, the settings and the content, so measure it: read the usage field of a real response, or use a token counting feature where one exists. The calculator below uses assumed numbers so you can see the arithmetic.

Python Stand-in: budget a document batch with assumed numbers

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The estimate changes by a factor of four across these assumptions. Run a few real pages first, then multiply. Remember that if you send the same document again in a new request, it counts again, although prompt caching may lower the price of repeated input.

What can go wrong

  • Small or blurry text may be misread. Crop and send a sharp image of the part that matters.
  • Tables and charts can lose rows, units or the link between a line and its legend.
  • Counting and precise positions in images deserve a second check.
  • Long documents may get answers that rest on one section and skip another.
  • Hidden instructions inside a file or image can try to steer the model. Treat document content as data, as in prompt injection.

A prompt for document questions

A clear request makes checking easier:

TEXT
Use only the attached report.
For each date you list, give: the date, what happens then,
the page number and a short exact quote.
If the report does not say something, write "not in the report".

This does not guarantee a correct answer. It gives you something concrete to verify.

Check with evidence

Verify the location and quote for each fact that matters. When you already have the text, a program can confirm that a quote really appears.

Python Check that quoted evidence exists

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A matching quote shows that the words exist, not that the conclusion follows from them. A failed match can also come from line breaks or extraction errors, so look at the original page. For scanned documents, you have no trustworthy text to compare against unless you check the text extraction too.

Screenshots often carry more than you intend: names in a sidebar, email addresses, access tokens in a terminal. Crop or redact before you upload, and follow your organization's rules for each product.

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. You added a large set of files to a project. What should you not assume?

    An app may retrieve only the parts it judges relevant.
  2. 2. How should you estimate the token cost of a PDF batch?

    Token use depends on the vendor, model, settings and page content.
  3. 3. A quote check succeeds. What has it shown?

    It verifies presence only. Meaning and conclusions still need review.

Summary

  • Both apps and both APIs accept more than plain text; supported types and limits differ and change.
  • In the APIs, a file is a content part sent next to your question.
  • Pages and images cost tokens; measure with real samples.
  • Ask for evidence, verify it, and redact private details before uploading.

Next: Cost, Latency and Caching

Your progress is saved in this browser. No account needed.