The Files API: upload files for use across multiple requests.
This is a beta endpoint and the files-api-2025-04-14 beta header is
added automatically.
{:ok, file} = ReqAnthropic.Files.create(path: "report.pdf")
ReqAnthropic.Files.list()
ReqAnthropic.Files.delete(file["id"])
Summary
Functions
Download the raw bytes of a file.
Upload a file. Pass either :path (a path on disk) or :content (an
iodata body) plus :filename. :content_type is optional but recommended.
Functions
@spec content( String.t(), keyword() ) :: {:ok, binary()} | {:error, ReqAnthropic.Error.t() | Exception.t()}
Download the raw bytes of a file.
@spec create(keyword()) :: {:ok, map()} | {:error, ReqAnthropic.Error.t() | Exception.t()}
Upload a file. Pass either :path (a path on disk) or :content (an
iodata body) plus :filename. :content_type is optional but recommended.
@spec delete( String.t(), keyword() ) :: {:ok, map()} | {:error, ReqAnthropic.Error.t() | Exception.t()}
@spec get( String.t(), keyword() ) :: {:ok, map()} | {:error, ReqAnthropic.Error.t() | Exception.t()}
@spec list(keyword()) :: {:ok, map()} | {:error, ReqAnthropic.Error.t() | Exception.t()}