Managed Agents - File

通过 multipart/form-data 上传一个 File,供 Session 或 Deployment 作为文件资源挂载。请求必须包含 file 字段,并受平台文件大小限制。

post/agent/managed/v1/files

Request

  • Base URL
    https://agent-api.bigmodel.cn/api
  • Auth
    HTTP bearer

Headers

zai-version'2026-05-26' required
Example:2026-05-26

Managed Agents API 入口要求的基础协议标识,当前只接受 2026-05-26;响应兼容形态由 zai-beta 选择。两个头均需携带。

zai-betastring required
Example:managed-agents-2026-09-22

声明 Managed Agents Beta 协议并选择响应字段与兼容行为。新接入使用 managed-agents-2026-09-22;旧客户端仍可使用 managed-agents-2026-05-26。必须同时携带 zai-version: 2026-05-26。字段差异见 /cn/managed-agents/protocol-versions。

Request body multipart/form-data

filestring binary required

Response

请求成功。

type'file' required
idstring required

File ID。

size_bytesinteger required
created_atstring date-time required

创建时间。

filenamestring required
mime_typestring required
downloadablefalse required

上传文件为 false,不可再下载;写入 /mnt/session/outputs 后编目的会话产物为 true。

expires_at'null' nullable

新协议固定为 null,不设自动过期时间;旧协议省略此字段。

Example response

{
  "type": "file",
  "id": "file_01911111-1111-7111-8111-111111111111",
  "size_bytes": 1024,
  "created_at": "2026-10-15T08:00:00.000Z",
  "filename": "report.txt",
  "mime_type": "text/plain",
  "downloadable": false,
  "expires_at": null
}

Changes