AnthropicClaude 托管智能体

添加会话资源

给会话挂载一份附加资源,供会话执行时使用。

POST /anthropic/v1/sessions/{session_id}/resources◐ 部分支持

请求参数

  • session_idstring必填

    path: 会话 ID(路径或查询参数)。

  • typestring必填

    query: 要新增的资源在请求体里对应的字段名。

    取值 file
  • file_idstring必填

    ID of a previously uploaded file.

  • mount_pathstring可选

    Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

返回

501

支持 file 类型资源的持久化、查询和解除关联,单会话最多 500 条。文件须属于当前租户且有效。默认路径为 /mnt/session/uploads/<file_id>,自定义路径归一到该目录,拒绝父目录遍历。不修改文件内容;本批尚不将资源同步到沙箱。

错误按 Claude Managed Agents 格式返回,参见 错误码

响应

HTTP 200

Successful response

application/json

名称类型说明
idstring
created_atstringA timestamp in RFC 3339 format
file_idstring
mount_pathstring
typestring
updated_atstringA timestamp in RFC 3339 format