Skip to main content
With Anthropic’s Files API, you can upload files and later reference them in other API calls. This is handy when a file is referenced multiple times in the same flow.

Usage

1

Upload a file

Initialize the Anthropic client and use client.beta.files.upload:
2

Initialize the Claude model

When initializing the Claude model, pass the necessary beta header:
3

Reference the file

You can now reference the uploaded file when interacting with your Agno agent:
Notice there are some storage limits attached to this feature. You can read more about that on Anthropic’s docs.

Working example

cookbook/11_models/anthropic/pdf_input_file_upload.py