简体中文
cURL
image_upload
curl --request POST \ --url https://sunoapiorg.redpandaai.co/api/file-stream-upload \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form uploadPath=images/user-uploads \ --form fileName=profile-picture.jpg \ --form file=@example-file
200
example
{ "success": true, "code": 200, "msg": "文件上传成功", "data": { "fileName": "uploaded-image.png", "filePath": "images/user-uploads/uploaded-image.png", "downloadUrl": "https://tempfile.redpandaai.co/xxx/images/user-uploads/uploaded-image.png", "fileSize": 154832, "mimeType": "image/png", "uploadedAt": "2025-01-01T12:00:00.000Z" }}
curl -X POST https://sunoapiorg.redpandaai.co/api/file-stream-upload \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@/path/to/your-file.jpg" \ -F "uploadPath=images/user-uploads" \ -F "fileName=custom-name.jpg"
所有 API 需要通过 Bearer Token 进行身份验证。
获取 API Key:
使用方法: 在请求头中添加: Authorization: Bearer YOUR_API_KEY
注意:
文件上传成功
The response is of type object.
object