Skip to main content

claude_api/files/
mod.rs

1//! The Files API (beta).
2//!
3//! Upload, download, list, and delete files. Once uploaded, file IDs can
4//! be referenced in [`DocumentSource::File`](crate::messages::DocumentSource::File)
5//! and [`ImageSource::File`](crate::messages::ImageSource::File) blocks
6//! instead of base64-encoding the bytes inline on every request.
7//!
8//! Upload and download both support **true streaming I/O** (no buffering
9//! the whole payload in memory) via the `_path` and `_to` variants.
10//!
11//! # Beta
12//!
13//! Every Files method automatically sends
14//! `anthropic-beta: files-api-2025-04-14`. Override the beta version on the
15//! [`Client`](crate::Client) builder if a newer revision is current.
16
17pub mod types;
18
19#[cfg(feature = "async")]
20#[cfg_attr(docsrs, doc(cfg(feature = "async")))]
21pub mod api;
22
23pub use types::{FileDeleted, FileMetadata, ListFilesParams};
24
25#[cfg(feature = "async")]
26pub use api::Files;