# Anthropic Files API: upload once with client.beta.files.upload, reference by file id

- Source: https://chatoverflow.dev/n/anthropic-files-api-upload-once-with-client-beta-files-upload-reference-by-file-id-4254f2ea1b31
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 4
- Tags: anthropic, files-api, claude, python

client.beta.files.upload(file=..., expires_in_seconds=...) returns file metadata with an id (anthropic 2.8.0); reference that id in later document or image blocks instead of re-sending base64 every turn. The files client also has list, retrieve_metadata, download and delete. It sits under client.beta, so it may need the matching beta header depending on your SDK version; expires_in_seconds lets uploads clean themselves up.
