files changedbuild-with-claude/files
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+16added
Lines−25removed
From line
123
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits25to this page, all time
The whole hunk
from line 123, old and new numbered
/
from line 123
123123 ```
124124
125125 ```php PHP
126 // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs.
127 $file = $client->beta->files->upload(
128 FileParam::fromResource(fopen('/path/to/document.pdf', 'rb'), contentType: 'application/pdf'),
126 $file = $client->files->upload(
127 file: FileParam::fromResource(fopen('/path/to/document.pdf', 'rb'), contentType: 'application/pdf'),
129128 );
130129
131130 $fileId = $file->id;
from line 329
330329 ```
331330
332331 ```php PHP
333 // The PHP SDK supports file_id document and image sources only through $client->beta->messages with the files beta.
334 $response = $client->beta->messages->create(
332 $response = $client->messages->create(
335333 maxTokens: 1024,
336334 messages: [
337335 [
from line 340
342340 'type' => 'document',
343341 'source' => [
344342 'type' => 'file',
345 'file_id' => $fileId
346 ]
347 ]
348 ]
349 ]
343 'fileID' => $fileId,
344 ],
345 ],
346 ],
347 ],
350348 ],
351349 model: 'claude-opus-5',
352 betas: ['files-api-2025-04-14'],
353350 );
354351
355 print_r($response);
352 echo $response;
356353 ```
357354
358355 ```ruby Ruby
from line 691
694691 ```
695692
696693 ```bash CLI
697 ant files list \
698 --max-items 10
694 ant files list --max-items 10
699695 ```
700696
701697 ```python Python
from line 735
739735 ```
740736
741737 ```php PHP
742 // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs.
743 // list() paginates with afterID, beforeID, and limit; page and ids[] are not parameters here.
744738 $client = new Client();
745739
746 $files = $client->beta->files->list();
740 $files = $client->files->list();
747741 echo $files;
748742 ```
749743
from line 798
804798 ```
805799
806800 ```php PHP
807 // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs.
808 $file = $client->beta->files->retrieveMetadata($fileId);
801 $file = $client->files->retrieveMetadata($fileId);
809802 echo $file;
810803 ```
811804
from line 848
855848 ```
856849
857850 ```php PHP
858 // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs.
859 $client->beta->files->delete($fileId);
851 $client->files->delete($fileId);
860852 ```
861853
862854 ```ruby Ruby
from line 924
932924 ```
933925
934926 ```php PHP
935 // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs.
936 $fileContent = $client->beta->files->download($fileId);
927 $fileContent = $client->files->download($fileId);
937928
938 file_put_contents("downloaded_file.txt", $fileContent);
929 file_put_contents('downloaded_file.txt', $fileContent);
939930 ```
940931
941932 ```ruby Ruby
No line in this hunk matches that.