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 Upload API Quickstart

Get started with the File Upload API in minutes, supporting multiple upload methods

Welcome to File Upload API#

The File Upload API provides flexible and efficient file upload services, supporting multiple upload methods to meet diverse business needs. Whether it's remote file migration, large file transmission, or quick small file uploads, our API offers the best solutions for your requirements.
Base64 Upload
Base64 encoded file upload, suitable for small files
File Stream Upload
Efficient binary file stream upload, ideal for large files
URL File Upload
Automatically download and upload files from remote URLs
File uploads are free - No charges apply for uploading files to our service. You can upload files without worrying about upload costs or fees.
Important Notice: Uploaded files are temporary and will be automatically deleted after 3 days. Please download or migrate important files promptly.

Authentication#

All API requests require authentication using Bearer tokens. Please obtain your API key from the API Key Management Page.
Please keep your API key secure and never share it publicly. If you suspect your key has been compromised, reset it immediately.

API Base URL#

https://sunoapiorg.redpandaai.co

Authentication Header#

Quick Start Guide#

Step 1: Choose Your Upload Method#

Select the appropriate upload method based on your needs:
URL File Upload
File Stream Upload
Base64 Upload
Suitable for downloading and uploading files from remote servers:
cURL
JavaScript
Python

Step 2: Handle Response#

Upon successful upload, you'll receive a response containing file information:
{
  "success": true,
  "code": 200,
  "msg": "File uploaded successfully",
  "data": {
    "fileId": "file_abc123456",
    "fileName": "my-image.jpg",
    "originalName": "sample-image.jpg",
    "fileSize": 245760,
    "mimeType": "image/jpeg",
    "uploadPath": "images",
    "fileUrl": "https://sunoapiorg.redpandaai.co/files/images/my-image.jpg",
    "downloadUrl": "https://sunoapiorg.redpandaai.co/download/file_abc123456",
    "uploadTime": "2025-01-15T10:30:00Z",
    "expiresAt": "2025-01-18T10:30:00Z"
  }
}

Upload Method Comparison#

Choose the most suitable upload method for your needs:
URL File Upload
Best for: File migration, batch processing
Advantages:
No local file required
Automatic download handling
Supports remote resources
Limitations:
Requires publicly accessible URL
30-second download timeout
Recommended ≤100MB
File Stream Upload
Best for: Large files, local files
Advantages:
High transmission efficiency
Supports large files
Binary transmission
Limitations:
Requires local file
Server processing time
Base64 Upload
Best for: Small files, API integration
Advantages:
JSON format transmission
Easy integration
Supports Data URL
Limitations:
Data size increases by 33%
Not suitable for large files
Recommended ≤10MB

Practical Examples#

Batch File Upload#

Using file stream upload to handle multiple files:
JavaScript
Python

Error Handling#

Common errors and handling methods:
401 Unauthorized
400 Bad Request
500 Server Error

Best Practices#

File Size Optimization
File Naming Guidelines
Performance Optimization
Security Considerations
Error Handling

File Storage Information#

Important Notice: All uploaded files are temporary and will be automatically deleted after 3 days.
Files are immediately accessible and downloadable after upload
File URLs remain valid for 3 days
The system provides an expiresAt field in the response indicating expiration time
It's recommended to download or migrate important files before expiration
Use the downloadUrl field to get direct download links

Status Codes#

200 · Success
Request processed successfully, file upload completed
400 · Bad Request
Request parameters are incorrect or missing required parameters
401 · Unauthorized
Authentication credentials are missing or invalid
405 · Method Not Allowed
Request method is not supported, please check HTTP method
500 · Server Error
An unexpected error occurred while processing the request, please retry or contact support

Next Steps#

URL File Upload
Learn how to upload files from remote URLs
File Stream Upload
Master efficient file stream upload methods
Base64 Upload
Understand Base64 encoded file uploads

Support#

Need help? Our technical support team is here to assist you.
Email: support@sunoapi.org
Documentation: docs.sunoapi.org
API Status: Check our status page for real-time API health

Ready to start uploading files? Get your API key and begin using the file upload service immediately!
Next
Base64 File Upload
Built with