Upload Files to AceDataCloud Platform CDN
Upload local files to the AceDataCloud platform CDN to obtain a permanently accessible URL (in the style of https://cdn.acedata.cloud/xxxxxx.png), which can be immediately referenced in other business interfaces (such as Midjourney, Suno, Flux) in parameters like image_url, reference_url, etc.
Applicable Scenarios:
- Upload the base image to the CDN to get the URL before calling Midjourney
/midjourney/imagine. - Cache the video generated in the previous step for use as input in the next step.
- Temporarily host user-uploaded materials to avoid building an S3.
ℹ️ This interface belongs to the AceDataCloud Platform Management API, with a unified prefix of
https://platform.acedata.cloud/api/v1/.
¶ Interface Overview
| Item | Content |
|---|---|
| Method | POST |
| URL | https://platform.acedata.cloud/api/v1/files/ |
| Authentication | ✅ Requires account token |
| Content-Type | multipart/form-data (not JSON) |
¶ Authentication Instructions (How to Obtain Account Token)
Request Header:
Authorization: Bearer platform-v1-92eb****629c
How to obtain: Log in to the AceDataCloud platform → Account Token Console → Click the "Create" button. For details, see Manage AceDataCloud Platform Account Tokens.
¶ Request Body (multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
file |
file | ✅ | Binary file stream. Single file limit is 50 MB by default |
filename |
string | No | Custom file name; if not provided, the filename from multipart will be used |
metadata |
string | No | JSON string, metadata attached to the file (note that it is a string, not an object, because multipart does not support native nested JSON) |
¶ Request Example
¶ cURL
curl -X POST 'https://platform.acedata.cloud/api/v1/files/' \
-H 'accept: application/json' \
-H 'authorization: Bearer platform-v1-92eb****629c' \
-F 'file=@./photo.jpg'
¶ Python
import requests
PLATFORM_TOKEN = "platform-v1-92eb****629c"
with open("photo.jpg", "rb") as f:
resp = requests.post(
"https://platform.acedata.cloud/api/v1/files/",
headers={
"accept": "application/json",
"authorization": f"Bearer {PLATFORM_TOKEN}",
},
files={"file": ("photo.jpg", f, "image/jpeg")},
timeout=60,
)
data = resp.json()
print(f"✅ Upload successful: {data['url']}")
# Directly used in other business interfaces:
# requests.post("https://api.acedata.cloud/midjourney/imagine",
# json={"prompt": "...", "image_urls": [data["url"]]}, ...)
¶ Node.js
const fs = require('fs')
const FormData = require('form-data')
const form = new FormData()
form.append('file', fs.createReadStream('./photo.jpg'))
const r = await fetch('https://platform.acedata.cloud/api/v1/files/', {
method: 'POST',
headers: {
authorization: 'Bearer platform-v1-92eb****629c',
...form.getHeaders(),
},
body: form,
})
const data = await r.json()
console.log('CDN URL:', data.url)
¶ Response Example (HTTP 201)
{
"id": "f-9c8b7a6d5e4f3a2b1c0d",
"user_id": "89518d07-5560-4b05-92c1-667f3ddf6a4b",
"filename": "photo.jpg",
"size": 184729,
"content_type": "image/jpeg",
"url": "https://cdn.acedata.cloud/qrd7gw.jpg",
"metadata": null,
"created_at": "2026-04-26T08:30:00Z"
}
You can directly use the url field in other business interfaces—CDN is permanently publicly accessible without authentication.
¶ Response Field Descriptions
| Field | Type | Description |
|---|---|---|
id |
string | File ID |
user_id |
UUID | Uploader user ID |
filename |
string | File name |
size |
integer | Size in bytes |
content_type |
string | MIME type |
url |
string | CDN access URL |
metadata |
object | null |
created_at |
string | Upload time |
¶ Error Handling
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid |
Missing file field, incorrect field name, metadata is not a valid JSON string |
| 401 | not_authenticated |
Missing account token |
| 413 | payload_too_large |
File exceeds 50 MB (default) |
¶ Practical Tips
- Upload images as base images: Midjourney
image_urls, Fluximage_url, Veoreference_urlall accept CDN URLs, not base64. Using this interface to obtain a URL is standard practice. urlis a permanent URL—there is currently no automatic cleanup policy, but do not upload sensitive data. If needed, please contact customer service to set a short-term TTL.metadatafield: multipart/form-data does not support native nested JSON, pass the string: "{\"campaign\":\"summer\"}", and the platform will deserialize it.- Bulk uploads: It is recommended to use 2-4 concurrent uploads, a single connection can achieve ~10 MB/s.
¶ Related Interfaces
- Get AceDataCloud Platform Service List — Find business services that accept URL input
- Create AceDataCloud Platform API Credentials — Usually, the next step after uploading is to create credentials to call business interfaces.
