Claude Platform Docs

上傳檔案

POST/v1/files

上傳檔案

Headers
"anthropic-version": optional string

The version of the Claude API you want to use.

Read more about versioning and our version history here.

"anthropic-workspace-id": optional string

Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).

Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

Body (form-data)
file: string

The file to upload. Only the final path component of the part's filename is kept; an absent or empty filename is replaced with unnamed plus the extension for the file's stored mime_type, when known.

formatbinary
expires_in_seconds: optional number

Seconds from upload until the file expires and its bytes become permanently unavailable. Must be between 3600 (one hour) and 7776000 (ninety days).

minimum3600
maximum7776000
Returns
FileMetadata object{ type