Sweep 22 Sep 2026 · 17:19Z Build v2.1.280 501 read Stable v2.1.267 Latest v2.1.280 Next v2.1.280 Feeds RSS JSON llms.txt Unofficial
One change · api

Files changed

api/beta/files

Nearest release: v2.1.251, 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+44added
Lines−28removed
From line 106 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits9to this page, all time

The whole hunk

from line 106, old and new numbered
/
lines
from line 106
106106 
107107 format: binary
108108 
109- `expires_in_seconds: optional number`
110 
111 Seconds from upload until the file expires and its bytes become permanently unavailable. Must be between 3600 (one hour) and 7776000 (ninety days).
112 
113 minimum: 3600, maximum: 7776000
114 
109115### Returns
110116 
111117- `BetaFileMetadata object`
from line 158
152158 
153159 default: false
154160 
161 - `expires_at: optional string or null`
162 
163 RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value.
164 
165 format: date-time
166 
155167 - `scope: optional BetaFileScope or null`
156168 
157169 The scope of this file, indicating the context in which it was created (e.g., a session).
from line 182
170182curl https://api.anthropic.com/v1/files \
171183 -H 'Content-Type: multipart/form-data' \
172184 -H 'anthropic-version: 2023-06-01' \
173 -H 'anthropic-beta: files-api-2025-04-14' \
174185 -H "X-Api-Key: $ANTHROPIC_API_KEY" \
175186 -F 'file=@/path/to/file'
176187```
from line 197
186197 "size_bytes": 102400,
187198 "type": "file",
188199 "downloadable": false,
200 "expires_at": "2025-05-15T18:37:24.100435Z",
189201 "scope": {
190202 "id": "id",
191203 "type": "session"
from line 213
201213 
202214### Query parameters
203215 
204- `after_id: optional string`
216- `ids: optional array of string`
205217 
206 ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
218 Restrict the result set to Files whose `id` is in this list. At most 100 entries (after de-duplication). Mutually exclusive with `page` and `limit`. When supplied, the response is always a single page (`next_page` is null). IDs that do not resolve to a visible File — including deleted Files — are silently omitted.
207219 
208- `before_id: optional string`
209 
210 ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
211 
212220- `limit: optional number`
213221 
214222 Number of items to return per page.
from line 225
217225 
218226 default: 20, maximum: 1000, minimum: 1
219227 
228- `page: optional string`
229 
230 Opaque page cursor returned in a prior list response's `next_page`. Prefixed `page_`.
231 
220232- `scope_id: optional string`
221233 
222234 Filter by scope ID. Only returns files associated with the specified scope (e.g., a session ID).
from line 373
361373 
362374 default: false
363375 
376 - `expires_at: optional string or null`
377 
378 RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value.
379 
380 format: date-time
381 
364382 - `scope: optional BetaFileScope or null`
365383 
366384 The scope of this file, indicating the context in which it was created (e.g., a session).
from line 391
373391 
374392 The type of scope (e.g., `"session"`).
375393 
376- `first_id: optional string or null`
394- `next_page: optional string or null`
377395 
378 ID of the first file in this page of results.
396 Opaque cursor for the next page. Supply as `?page=` to fetch the next page; null when there are no more results.
379397 
380- `has_more: optional boolean`
381 
382 Whether there are more results available.
383 
384 default: false
385 
386- `last_id: optional string or null`
387 
388 ID of the last file in this page of results.
389 
390398### Example
391399 
392400```bash
393401curl https://api.anthropic.com/v1/files \
394402 -H 'anthropic-version: 2023-06-01' \
395 -H 'anthropic-beta: files-api-2025-04-14' \
396403 -H "X-Api-Key: $ANTHROPIC_API_KEY"
397404```
398405 
from line 416
409416 "size_bytes": 102400,
410417 "type": "file",
411418 "downloadable": false,
419 "expires_at": "2025-05-15T18:37:24.100435Z",
412420 "scope": {
413421 "id": "id",
414422 "type": "session"
from line 423
415423 }
416424 }
417425 ],
418 "first_id": "file_011CNha8iCJcU1wXNR6q4V8w",
419 "has_more": true,
420 "last_id": "file_013Zva2CMHLNnXjNJJKqJ2EF"
426 "next_page": "next_page"
421427}
422428```
423429 
from line 536
530536```bash
531537curl https://api.anthropic.com/v1/files/$FILE_ID/content \
532538 -H 'anthropic-version: 2023-06-01' \
533 -H 'anthropic-beta: files-api-2025-04-14' \
534539 -H "X-Api-Key: $ANTHROPIC_API_KEY"
535540```
536541 
from line 689
684689 
685690 default: false
686691 
692 - `expires_at: optional string or null`
693 
694 RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value.
695 
696 format: date-time
697 
687698 - `scope: optional BetaFileScope or null`
688699 
689700 The scope of this file, indicating the context in which it was created (e.g., a session).
from line 712
701712```bash
702713curl https://api.anthropic.com/v1/files/$FILE_ID \
703714 -H 'anthropic-version: 2023-06-01' \
704 -H 'anthropic-beta: files-api-2025-04-14' \
705715 -H "X-Api-Key: $ANTHROPIC_API_KEY"
706716```
707717 
from line 726
716726 "size_bytes": 102400,
717727 "type": "file",
718728 "downloadable": false,
729 "expires_at": "2025-05-15T18:37:24.100435Z",
719730 "scope": {
720731 "id": "id",
721732 "type": "session"
from line 860
849860curl https://api.anthropic.com/v1/files/$FILE_ID \
850861 -X DELETE \
851862 -H 'anthropic-version: 2023-06-01' \
852 -H 'anthropic-beta: files-api-2025-04-14' \
853863 -H "X-Api-Key: $ANTHROPIC_API_KEY"
854864```
855865 
from line 935
925935 Whether the file can be downloaded.
926936 
927937 default: false
938 
939 - `expires_at: optional string or null`
940 
941 RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value.
942 
943 format: date-time
928944 
929945 - `scope: optional BetaFileScope or null`
930946