curl --request POST \
--url https://sunoapiorg.redpandaai.co/api/file-url-upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileUrl": "https://example.com/images/sample.jpg",
"uploadPath": "images/downloaded",
"fileName": "my-downloaded-image.jpg"
}
'
{
"success": true,
"code": 200,
"msg": "File uploaded successfully",
"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"
}
}File Upload API
URL File Upload
POST
/
api
/
file-url-upload
curl --request POST \
--url https://sunoapiorg.redpandaai.co/api/file-url-upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileUrl": "https://example.com/images/sample.jpg",
"uploadPath": "images/downloaded",
"fileName": "my-downloaded-image.jpg"
}
'
{
"success": true,
"code": 200,
"msg": "File uploaded successfully",
"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"
}
}Download files from URLs and upload them as temporary files. Note: Uploaded files are temporary and automatically deleted after 3 days.
Features
- Supports HTTP and HTTPS file links
- Automatically downloads remote files and uploads them
- Automatically extracts file names from URLs or uses custom file names
- Automatic MIME type recognition
- Returns complete file information and download links
- API Key authentication protection
- Uploaded files are temporary and automatically deleted after 3 days
Supported Protocols
- HTTP:
http://example.com/file.jpg - HTTPS:
https://example.com/file.jpg
Use Cases
- Migrating files from other services
- Batch downloading and storing web resources
- Backing up remote files
- Caching external resources
Important Notes
- Ensure the provided URL is publicly accessible
- Download timeout is 30 seconds
- Recommended file size limit is 100MB
Authorizations
All APIs require authentication via Bearer Token.
Get API Key:
- Visit API Key Management Page to get your API Key
Usage: Add to request header: Authorization: Bearer YOUR_API_KEY
Note:
- Keep your API Key secure and do not share it with others
- If you suspect your API Key has been compromised, reset it immediately in the management page
Body
application/json
File download URL, must be a valid HTTP or HTTPS address
Example:
"https://example.com/images/sample.jpg"
File upload path, without leading or trailing slashes
Example:
"images/downloaded"
File name (optional), including file extension. If not provided, a random filename will be generated. If the same filename already exists, the old file will be overwritten, but changes may not be immediately visible due to caching
Example:
"sample-image.jpg"
