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

Install dependencies

2

Export your Anthropic API key

3

Upload a file

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

Initialize the Claude model

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

Reference the file

You can now reference the uploaded file when interacting with your Agno agent:
Uploaded files count against storage limits. See Anthropic’s docs for the details.

Working example

cookbook/90_models/anthropic/pdf_input_file_upload.py