Generated Files
获取 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
}
下载 Claude 生成的文件
get /v1/compliance/apps/chats/generated-files/{claude_gen_file_id}/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
示例
curl https://api.anthropic.com/v1/compliance/apps/chats/generated-files/$CLAUDE_GEN_FILE_ID/content \
-H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"
领域类型
Generated File Retrieve Response
-
GeneratedFileRetrieveResponse object { id, claude_chat_id, created_at, 4 more }GET /v1/compliance/apps/chats/generated-files/{claude_gen_file_id} 的元数据。
仅返回元数据。使用同级
/content端点下载文件字节。包含所属聊天,因为 ID 是不透明的;要找到生成该文件的特定消息,请获取/v1/compliance/apps/chats/{claude_chat_id}/messages并匹配generated_files[].id。-
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存储文件的字节大小(如可用)
-