You need to enable JavaScript to run this app.
文档中心
火山方舟

火山方舟

复制全文
下载 pdf
会话资源
添加会话资源
复制全文
下载 pdf
添加会话资源
POST https://ark.cn-beijing.volces.com/api/v3/sessions/{session_id}/resources​
将 Files API 中的文件添加到已有会话的托管运行环境。当前仅支持 file,并以只读方式挂载。​
添加成功后,请使用响应中的 file_id 查询或引用该文件。本接口仅适用于绑定托管运行环境的会话。​
说明​
挂载后,智能体通过 mount_path 读取文件;未指定该字段时,路径为 /mnt/session/uploads/<filename>。若还需要将同一文件传入模型上下文,请在 user.message 的 content[] 中引用响应中的 file_id。​
鉴权​
本接口支持鉴权方式如下,详情请参见 Base URL 及鉴权。​
  • API Key 鉴权,请在 API Key 管理 页面,获取长效 API Key。​
​​
请求参数​
Path 参数​
session_id string 必选 | 会话 ID​
​
​
Body 参数​
file_id string 必选 | 文件 ID​
​
type string 必选 | 资源类型​
​
mount_path string | 挂载路径​
​
​
响应参数​
access string | 访问模式​
​
type string | 资源类型​
​
created_at string | 创建时间​
​
file_id string | 文件 ID​
​
id string | 资源 ID​
​
mount_path string | 挂载路径​
​
updated_at string | 更新时间​
​
​

Request

curl -sS --fail-with-body "https://ark.cn-beijing.volces.com/api/v3/sessions/<SESSION_ID>/resources" \
  -H "Authorization: Bearer $ARK_API_KEY" \
  -H "Content-Type: application/json" \
  -d @- <<'EOF'
{
  "type": "file",
  "file_id": "<FILE_ID>",
  "mount_path": "workspace/input.txt"
}
EOF

Response

{
  "id": "sesrsc-01hx3z9r0w8n3p5q6s7t8v9x20",
  "type": "file",
  "file_id": "<FILE_ID>",
  "mount_path": "/mnt/session/uploads/workspace/input.txt",
  "created_at": "2026-07-15T08:30:20.000Z",
  "updated_at": "2026-07-15T08:30:20.000Z"
}
最近更新时间:2026.10.09 19:08:07
这个页面对您有帮助吗?
有用
有用
无用
无用