Anthropic::Beta::FilesAPI
Beta-scoped file operations with automatic beta header merging.
Wraps Files::API so that every request includes the beta namespace
headers configured on the parent Beta::API, merged (deduplicated)
with any per-request options the caller passes.
Usage
client = Anthropic::Client.new
# Upload a file through the beta namespace
file = client.beta(["files-beta-2025"]).files.upload("doc.txt", "content")
# Per-request options are merged, not overwritten
opts = Anthropic::RequestOptions.new(beta_headers: ["extra-beta"])
file = client.beta(["files-beta-2025"]).files.retrieve("file_123", opts)
# => request includes both "files-beta-2025" AND "extra-beta"
Constructors
Instance methods
Delete a file.
Download file content as raw bytes.
Download file content as base64.
Download file content as string.
list(params : ListParams = ListParams.new, request_options : RequestOptions | Nil = nil) : Page(File)
List files with pagination.
list_all(limit : Int32 | Nil = nil, request_options : RequestOptions | Nil = nil) : AutoPaginator(File)
Auto-paginating iterator for listing all files.
Retrieve a specific file by ID.
Upload a file via an UploadFileRequest.