Follow Discord
Sweep 22 Oct 2026 · 21:04Z Build v2.1.309 528 read Stable v2.1.308 Latest v2.1.308 Next v2.1.309 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

pdf-support changedbuild-with-claude/pdf-support

Nearest release: v2.1.239, published 2 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+9added
Lines−12removed
From line 425 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits14to this page, all time

The whole hunk

from line 425, old and new numbered
/
lines
from line 425
425425 
426426 ```python Python
427427 import base64
428 import httpx
428 import httpx2
429429 
430430 # First, load and encode the PDF
431431 pdf_url = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
432432 pdf_data = base64.standard_b64encode(
433 httpx.get(pdf_url, follow_redirects=True).content
433 httpx2.get(pdf_url, follow_redirects=True).content
434434 ).decode("utf-8")
435435 
436436 # Alternative: Load from a local file
from line 941
941941 ```
942942 
943943 ```php PHP
944 // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs.
945 // The PHP SDK supports file_id document and image sources only through $client->beta->messages with the files beta.
946944 use Anthropic\Core\FileParam;
947945 
948946 $client = new Client();
949947 
950948 // Upload the PDF file
951 $file_upload = $client->beta->files->upload(
949 $file_upload = $client->files->upload(
952950 file: FileParam::fromResource(fopen('/path/to/document.pdf', 'r'), contentType: 'application/pdf'),
953951 );
954952 
955953 // Use the uploaded file in a message
956 $message = $client->beta->messages->create(
954 $message = $client->messages->create(
957955 maxTokens: 1024,
958 betas: ['files-api-2025-04-14'],
959956 messages: [
960957 [
961958 'role' => 'user',
from line 961
964961 'type' => 'document',
965962 'source' => [
966963 'type' => 'file',
967 'file_id' => $file_upload->id,
964 'fileID' => $file_upload->id,
968965 ],
969966 ],
970967 [
from line 1120
11231120 
11241121 ```python Python
11251122 import base64
1126 import httpx
1123 import httpx2
11271124 
11281125 # First, load and encode the PDF
11291126 pdf_url = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
11301127 pdf_data = base64.standard_b64encode(
1131 httpx.get(pdf_url, follow_redirects=True).content
1128 httpx2.get(pdf_url, follow_redirects=True).content
11321129 ).decode("utf-8")
11331130 
11341131 # Create a message with the cached document
from line 1488
14911488 
14921489 ```python Python
14931490 import base64
1494 import httpx
1491 import httpx2
14951492 
14961493 # First, load and encode the PDF
14971494 pdf_url = "https://assets.anthropic.com/m/1cd9d098ac3e6467/original/Claude-3-Model-Card-October-Addendum.pdf"
14981495 pdf_data = base64.standard_b64encode(
1499 httpx.get(pdf_url, follow_redirects=True).content
1496 httpx2.get(pdf_url, follow_redirects=True).content
15001497 ).decode("utf-8")
15011498 
15021499 # Create a batch of requests that use the document
Feedback