Claude Platform Docs

Download File

files.download(strfile_id) -> BinaryResponseContent
GET/v1/files/{file_id}/content

Download File

Parameters
file_id: str

ID of the File.

Returns
BinaryResponseContent

Download File

import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ.get(
        "ANTHROPIC_API_KEY"
    ),  # This is the default and can be omitted
)
response = client.files.download(
    "file_id",
)
print(response)
content = response.read()
print(content)