Skip to main content
POST
/
v1
/
files
/
upload
上传文件
curl --request POST \
  --url https://model-api.skyengine.com.cn/v1/files/upload \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'filename: <filename>' \
  --data '"[文件的二进制数据内容]"'
{
  "uri": "tokenops://bucket.example.com/file_api/20241016/test.mp4",
  "mime_type": "video/mp4"
}

Authorizations

Authorization
string
header
required

API-Key 鉴权。所有 API 请求都应在 Authorization HTTP Header 中包含您的 API-Key,格式为 Bearer {API_KEY}

Headers

Content-Type
enum<string>
default:application/octet-stream
required

请求内容类型

Available options:
application/octet-stream
filename
string
required

文件名称,不能超过 255 个字符

Maximum string length: 255

Body

application/octet-stream

文件的二进制内容。将本地文件直接读取为二进制数据,并作为 HTTP 请求体发送。使用 curl 时可以通过 --data-binary @./文件路径--upload-file ./文件路径 来上传文件;编程语言中需要将文件读取为字节流并设置为请求体。

文件的原始二进制数据。注意:不是 base64 编码,而是文件的直接字节内容。

Response

200 - application/json

文件上传成功

uri
string
required

文件的访问 URI,使用 tokenops:// 协议格式

Example:

"tokenops://bucket.example.com/file_api/20241016/example.mp4"

mime_type
string
required

系统检测到的文件 MIME 类型

Example:

"video/mp4"