AgentConnect
Agents

Reserve a file upload

Reserve one file upload for a chat turn with this agent and return short-lived presigned requests into the deployment’s object store. A file of at most the runtime config’s fileTransfer.partBytes (or any file when it is absent) goes in one PUT: the browser hashes it (sha256, base64), sends exactly the returned headers and the declared number of bytes, then names uploadId in the turn’s files. A larger file goes in parts: the browser sends parts (its part size, at most partBytes, and each part’s sha256) with sha256 set to the composite (the sha256 of the parts’ raw digests), PUTs each part on the returned URLs (asking …/uploads/:uploadId/parts for the rest), then POSTs the CompleteMultipartUpload XML to complete before naming uploadId. The agent receives a download link, never the bytes through the control plane. Uploaded objects expire with the store’s lifecycle rule. 409 WORKSPACE_TRANSFER_UNAVAILABLE when the deployment has no transfer bucket or it cannot take one right now, 409 DAEMON_FEATURE_MISSING when the agent’s daemon cannot fetch uploads yet, 400 WORKSPACE_TOO_LARGE over the transfer cap, 400 WORKSPACE_UPLOAD_INVALID when the parts do not describe the file.

POST
/v1/orgs/{orgId}/agents/{id}/uploads

授权

bearerAuth
授权Bearer <token>

位置: header

路径参数

orgId*string
id*string

请求主体

application/json

TypeScript 定义

在 TypeScript 中使用 request body 类型。

响应主体

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/orgs/string/agents/string/uploads" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "mimeType": "string",    "size": 1,    "sha256": "string"  }'
{  "url": "string",  "headers": {    "property1": "string",    "property2": "string"  },  "uploadId": "string",  "expiresAt": "string"}