上传 Agent file
在 Thread 创建前,将文件上传到 Agent API Endpoint 所属 Project 的 draft scope。将返回的文件 ID 用于 create-thread 或 send-events 的 resources。
POST
/agents/{agentId}/files在 Thread 创建前,将文件上传到 Agent API Endpoint 所属 Project 的 draft scope。将返回的文件 ID 用于 create-thread 或 send-events 的 resources。
Authorization
publicApiBearer AuthorizationBearer <token>
使用 Authorization: Bearer msp_...。Project API key 只能配置、执行和访问本 Project 的 Agent、Session 和文件。密钥和账号管理需要 console 或 CLI 登录。旧账号 token 已被拒绝。
In: header
Path Parameters
agentId*string
来自 Agent API Access 面板的 Agent API Endpoint ID。v1 ID 是不带前缀的 ULID。
Match
^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$Format
ulidRequest Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/agents/01J00000000000000000000001/files" \ -F file="string"{ "file": { "createdAt": "2026-05-19T00:02:00.000Z", "id": "01J0000000000000000000000J", "mimeType": "text/plain", "name": "brief.txt", "size": 19 }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}