获取 Claude 生成的文件元数据
get /v1/compliance/apps/chats/generated-files/{claude_gen_file_id}
返回助手通过工具使用创建的文件的元数据。
元数据从 Filestore(每个对话工具输出的持久后备存储)读取。使用同级 /content 端点下载文件字节。
路径参数
-
claude_gen_file_id: string生成文件 ID(例如 'claude_gen_file_abc123'),在 GET /apps/chats/{claude_chat_id}/messages 的
chat_messages[].generated_files[].id中返回。
请求头参数
"x-api-key": optional string
返回值
-
id: string不透明的生成文件 ID,例如 'claude_gen_file_abc123'。
-
claude_chat_id: string此生成文件所属的聊天
-
created_at: string来自 Filestore 的文件创建时间戳
-
filename: string生成文件的显示名称
-
md5: string存储文件的小写十六进制 MD5,由 Filestore 记录。如果没有可用的存储哈希值,则为 null。同级
/content端点还会设置一个Content-MD5请求头(按 RFC 1864 进行 base64 编码),基于实际提供的字节计算。 -
mime_type: stringFilestore 记录的 MIME 类型(如可用)
-
size_bytes: number存储文件的字节大小(如可用)
示例
curl https://api.anthropic.com/v1/compliance/apps/chats/generated-files/$CLAUDE_GEN_FILE_ID \
-H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"
响应
{
"id": "id",
"claude_chat_id": "claude_chat_id",
"created_at": "2019-12-27T18:11:19.117Z",
"filename": "filename",
"md5": "md5",
"mime_type": "mime_type",
"size_bytes": 0
}