Anthropic

读取文件信息

返回单个文件的信息。

先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。

GET /anthropic/v1/files/{file_id}● 支持

Anthropic 官方文档 ↗

请求参数

  • file_idstring必填

    path:

返回

200

错误按 Anthropic 格式返回,参见 错误码

响应

HTTP 200

Metadata

application/json

名称类型说明
idstringUnique object identifier. The format and length of IDs may change over time.
created_atstringRFC 3339 datetime string representing when the file was created.
filenamestringOriginal filename of the uploaded file.
mime_typestringMIME type of the file.
size_bytesnumberSize of the file in bytes.
typestringObject type. For files, this is always `"file"`.
downloadablebooleanWhether the file can be downloaded.
expires_atnull | stringRFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value.
scopenull | objectThe scope of this file, indicating the context in which it was created (e.g., a session).
scope.idstringThe ID of the scoping resource (e.g., the session ID).
scope.typestringThe type of scope (e.g., `"session"`).