Upload Image
Uploads
Upload Image
Call /api/upload/presign to generate a pre-signed upload URL, then pass the returned public_url to interfaces that accept public asset URLs.
POST
Upload Image
Upload Image
This API does not directly accept file contents. Instead, it first issues an object storagePUT URL. After the client obtains the URL, it uploads the file on its own.
- Suitable for pre-uploading images, the first frame of a video, and other media assets.
- Uses API Key authentication, but the returned structure is wrapped in
/api/*success/message/data. - The default expiration time is
900seconds, with a minimum of60seconds and a maximum of3600seconds. - When
prefixis not explicitly provided, the system automatically generates theuploads/user/{id}prefix based on the current user.
Method and Path
Request Example
Response Example
Authentication
Body
The original file name. The server will generate the object key based on the extension. It also works if omitted, but it is generally recommended to pass it explicitly.
The file MIME type, such as
image/png, image/jpeg, or video/mp4.The validity period of the pre-signed URL, in seconds. The server automatically constrains it between
60 and 3600.The object key prefix. If not provided,
uploads/user/{id} is used by default.Response
Whether the request succeeded.
/api/* endpoints use this field first to indicate the business result.The upload method, currently fixed as
PUT.The signed object storage upload URL.
The public URL that can be directly passed to image, video, and task endpoints after a successful upload.
Use Cases
Use it as a media URL after uploading
- Call
/api/upload/presignto obtainupload_urlandpublic_url. - Upload the file by sending a
PUTrequest toupload_url. - Pass
public_urlas the input field to interfaces that accept public media URLs.