struct

Anthropic::FileMetadata

Inherits JSON::Serializable < Struct < Value < Object

File metadata returned by the Files API

file = client.beta.files.retrieve("file_abc123")
puts file.filename     # => "document.pdf"
puts file.size_bytes   # => 1024000
puts file.downloadable # => false (uploaded files are not downloadable)

Constructors

new(id : String, type : String, filename : String, mime_type : String, size_bytes : Int64, created_at : String, downloadable : Bool)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

created_at

ISO 8601 timestamp when file was created

Source
downloadable?

Whether the file can be downloaded Only files created by Claude (via code execution) are downloadable

Source
filename

Original filename

Source
id

Unique identifier for this file

Source
mime_type

MIME type of the file

Source
size_bytes

File size in bytes

Source
type

Object type, always "file"

Source