Get File Metadata
beta.files.retrieve_metadata(file_id, **kwargs) -> BetaFileMetadataGET/v1/files/{file_id}
Get File Metadata
require "anthropic"
anthropic = Anthropic::Client.new(api_key: "my-anthropic-api-key")
beta_file_metadata = anthropic.beta.files.retrieve_metadata("file_id")
puts(beta_file_metadata){
"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,
"expires_at": "2025-05-15T18:37:24.100435Z",
"scope": {
"id": "id",
"type": "session"
}
}Returns Examples
{
"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,
"expires_at": "2025-05-15T18:37:24.100435Z",
"scope": {
"id": "id",
"type": "session"
}
}