List Files
Parameters
after_id: Optional[str]
ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
before_id: Optional[str]
ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
limit: Optional[int]
Number of items to return per page.
Defaults to 20. Ranges from 1 to 1000.
maximum1000
minimum1
Returns
List Files
Python
from anthropic import Anthropic
client = Anthropic(
api_key="my-anthropic-api-key",
)
page = client.beta.files.list()
page = page.data[0]
print(page.id){
"data": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"filename": "x",
"mime_type": "x",
"size_bytes": 0,
"type": "file",
"downloadable": true
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id"
}Returns Examples
{
"data": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"filename": "x",
"mime_type": "x",
"size_bytes": 0,
"type": "file",
"downloadable": true
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id"
}