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 platformAccount 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 28 MB by default

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['file_url']}")
# Directly used in other business interfaces:
# requests.post("https://api.acedata.cloud/midjourney/imagine",
#     json={"prompt": "...", "image_urls": [data["file_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.file_url)

Response Example (HTTP 200)

{
  "file_url": "https://cdn.acedata.cloud/qrd7gw.jpg"
}

Simply take the file_url field and use it in other business interfaces—CDN is permanently publicly accessible, no authentication required.

Response Field Description

Field Type Description
file_url string CDN access URL

Error Handling

HTTP Response Example Meaning
400 {"error":"No file provided"} No file field attached or field name is incorrect
401 DRF authentication error response Missing or invalid account token
413 {"error":"File too large","max_bytes":...} File exceeds 28 MB (default)

Practical Tips

  • Upload images as base images: Midjourney image_urls, Flux image_url, and Veo reference_url all accept CDN URLs, not base64. Using this interface to obtain a URL is standard practice.
  • file_url is a permanent URL—currently, there is no automatic cleanup policy, but do not upload sensitive data. If needed, please contact customer service to set a short-term TTL.
  • Bulk uploads: Recommended 2-4 concurrent uploads, a single connection can achieve ~10 MB/s.