docs.sunoapi.org
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Support
Suno APICommon APIFile Upload API
Suno APICommon APIFile Upload API
  1. File Upload API
  • File Upload API Quickstart
  • Base64 File Upload
    POST
  • File Stream Upload
    POST
  • URL File Upload
    POST
  1. File Upload API

File Stream Upload

POST
/api/file-stream-upload
Upload temporary files via multipart/form-data format. Note: Uploaded files are temporary and automatically deleted after 3 days.

Features#

Supports binary stream upload for various file types
Suitable for large file uploads with high transmission efficiency
Automatic MIME type recognition
Support for custom file names or using original file names
Returns complete file information and download links
API Key authentication protection
Uploaded files are temporary and automatically deleted after 3 days

Usage Recommendations#

Recommended for large files (>10MB)
Supports various formats: images, videos, documents, etc.
Transmission efficiency is approximately 33% higher than Base64 format

Example Command#

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params multipart/form-dataRequired

Responses

🟢200Success
application/json
File uploaded successfully
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location '/api/file-stream-upload' \
--header 'Authorization: Bearer <token>' \
--form 'file=@""' \
--form 'uploadPath="images/user-uploads"' \
--form 'fileName="my-image.jpg"'
Response Response Example
200 - Success Example
{
    "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"
    }
}
Previous
Base64 File Upload
Next
URL File Upload
Built with