跳转到主要内容
POST
/
api
/
v1
/
files
/
presign-upload
申请 presigned 上传 URL。
curl --request POST \
  --url https://openapi.beeos.ai/api/v1/files/presign-upload \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "filename": "<string>",
  "content_type": "<string>"
}
'
{
  "success": true,
  "data": {
    "file_id": "<string>",
    "upload_url": "<string>",
    "download_url": "<string>",
    "download_expires_in": 123
  }
}

授权

Authorization
string
header
必填

通过 Authorization: Bearer <token> header 传用户 JWToag_ User API Key。两者都由 openapi-gateway 对 Auth service 验证。

JWT 与 API Key 都是 user-scoped:每个 key(以及每个 JWT) 绑定到唯一 owner,所有路由都自动放开该 owner 名下的全部资源。 跨租户访问由 handler 内的 owner-ACL 拦截 —— API 表面没有 per-route scope 词汇。

v1.1.0 已移除: 历史 scope 词汇(agents:* / tasks:* / files:* / instances:*)以及 403 insufficient_scope 错误码已下线。已签发的 oag_ key 自动获得 owner 全权限, 无需重建。之前显式传 scopes 调用 createAPIKey 的 SDK 客户端可以直接删除该参数。详见文末 changelog 迁移说明。

请求体

application/json
filename
string
必填

原始 filename 提示;存在文件记录上。

Maximum string length: 512
content_type
string
必填

上传字节的 MIME 类型(例如 image/png)。Content-Type 不同的上传可能被存储后端拒绝。

Maximum string length: 255

响应

已签发 presigned URL。

success
boolean
必填
data
object