Get File Metadata
client.beta.files.retrieveMetadata(stringfileID, FileRetrieveMetadataParams { betas } params?, RequestOptionsoptions?): FileMetadata { id, created_at, filename, 4 more }
/v1/files/{file_id}?beta=true
Get File Metadata
Parameters
fileID: string
ID of the File.
Returns
Get File Metadata
TypeScript
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: 'my-anthropic-api-key',
});
const fileMetadata = await client.beta.files.retrieveMetadata('file_id');
console.log(fileMetadata.id);{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"filename": "x",
"mime_type": "x",
"size_bytes": 0,
"type": "file",
"downloadable": true
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"filename": "x",
"mime_type": "x",
"size_bytes": 0,
"type": "file",
"downloadable": true
}