Theme
Upload file
Call /v1/file/upload to generate a presigned upload URL, then pass the returned download_url to APIs that accept public asset URLs.
http
PUT /v1/file/uploadThis API does not accept file content directly. It issues an object-storage PUT URL; the client uploads the file to that URL. It is suited to pre-uploading images, video, and other media, and uses API Key authentication.
The default expiration for the presigned URL is 900 seconds; the minimum is 60 seconds and the maximum is 3600 seconds.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Request authentication. Use a Bearer Token, for example: | |
| string | Yes | Request content type; must be |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| object | No | Custom headers for the upload request | |
| string | No | File MIME type, e.g. , , | |
| object | No | Additional query parameters for the upload URL; pass an empty object if not needed |
Request example
bash
curl -X PUT https://octopusx.ai/v1/file/upload \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"headers": {
"Content-Type": "image/png"
},
"params": {}
}'bash
curl -X PUT https://octopusx.ai/v1/file/upload \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"headers": {
"Content-Type": "video/mp4"
},
"params": {}
}'Response example
json
{
"download_url": "https://xxxx.cn/uploads/file/2026/djlh2xxxxffqhkt.png",
"expire": 3600,
"method": "PUT",
"upload_url": "https://.../uploads/user/12/20260519-abcdef.png?signature=..."
}Response fields
| Name | Type | Description |
|---|---|---|
| string | Public URL you can pass directly to image, video, and task APIs after a successful upload | |
| integer | Expiration of the presigned URL, in seconds | |
| string | Upload method; currently fixed to | |
| string | Signed object-storage upload URL |
Upload the file to the presigned URL
After you receive upload_url, send a PUT request with the file body to that URL. Content-Type must match the value you provided when requesting the presigned URL.
bash
# Upload video (Content-Type must match the video/mp4 declared when obtaining upload_url)
curl -X PUT "https://.../uploads/user/12/20260519-abcdef.mp4?signature=..." \
-H "Content-Type: video/mp4" \
--data-binary @/path/to/video.mp4Use cases
Upload then use with asset-URL APIs
- Call
/v1/file/uploadto obtainupload_urlanddownload_url PUTthe file toupload_url- Pass
download_urlas an input field to APIs that accept public asset URLs
Notes
WARNING
This API only issues an upload URL; it does not upload the file for you. The client must send a separate PUT to upload_url with the file content.