List Files
beta.files.list(**kwargs) -> Page<FileMetadata { id, created_at, filename, 4 more } >
GET/v1/files
List Files
Parameters
after_id: String
ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
before_id: String
ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
Returns
List Files
require "anthropic"
anthropic = Anthropic::Client.new(api_key: "my-anthropic-api-key")
page = anthropic.beta.files.list
puts(page)Response 200
{
"data": [
{
"id": "file_011CNha8iCJcU1wXNR6q4V8w",
"created_at": "2025-04-15T18:37:24.100435Z",
"filename": "document.pdf",
"mime_type": "application/pdf",
"size_bytes": 102400,
"type": "file",
"downloadable": false
}
],
"first_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"has_more": true,
"last_id": "file_013Zva2CMHLNnXjNJJKqJ2EF"
}Returns Examples
Response 200
{
"data": [
{
"id": "file_011CNha8iCJcU1wXNR6q4V8w",
"created_at": "2025-04-15T18:37:24.100435Z",
"filename": "document.pdf",
"mime_type": "application/pdf",
"size_bytes": 102400,
"type": "file",
"downloadable": false
}
],
"first_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"has_more": true,
"last_id": "file_013Zva2CMHLNnXjNJJKqJ2EF"
}