Skip to main content
GET
下载文件

Authorizations

Authorization
string
header
required

每个请求都通过 API Key 认证:Authorization: Bearer {API_KEY}。应用接口使用应用 API Key,知识库接口使用知识库 API Key(快速开始)。

API Key 应保存在服务端,切勿嵌入客户端代码。缺失或无效的 Key 会返回 HTTP 401unauthorized)。

Path Parameters

file_id
string<uuid>
required

要下载的文件 ID,来自上传文件的响应。

Query Parameters

as_attachment
boolean
default:false

true 时,文件以附件形式下载,而不是在浏览器中内联渲染。

user
string

终端用户标识,由你的应用定义,需在应用内唯一。此处对文件访问没有影响,文件访问按应用和消息(而非 user)限定。参见 终端用户身份

Response

返回原始文件内容。Content-Type 头设置为文件的 MIME 类型。如果 as_attachmenttrue,文件将以 Content-Disposition: attachment 方式作为下载返回。

The response is of type file.

Last modified on July 22, 2026