Get File Metadata
beta.files.retrieve_metadata(file_id, **kwargs) -> FileMetadata { id, created_at, filename, 4 more }
GET/v1/files/{file_id}
Get File Metadata
Parameters
file_id: String
ID of the File.
Returns
Get File Metadata
require "anthropic"
anthropic = Anthropic::Client.new(api_key: "my-anthropic-api-key")
file_metadata = anthropic.beta.files.retrieve_metadata("file_id")
puts(file_metadata)Response 200
{
"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
}Returns Examples
Response 200
{
"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
}