List Files
client.files.list(FileListParamsquery?, RequestOptionsoptions?): PageCursor<FileMetadata>GET/v1/files
List Files
Parameters
Returns
List Files
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const fileMetadata of client.files.list()) {
console.log(fileMetadata.id);
}{
"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,
"expires_at": "2025-05-15T18:37:24.100435Z"
}
],
"next_page": "next_page"
}Returns Examples
{
"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,
"expires_at": "2025-05-15T18:37:24.100435Z"
}
],
"next_page": "next_page"
}