Upload Files to the qiyaov Platform CDN
Upload local files to the qiyaov platform CDN to obtain a publicly accessible URL (in the style of https://cdn.acedata.cloud/xxxxxx.png), which can be immediately referenced in parameters such as image_url, reference_url, etc. of other business APIs (such as Midjourney, Suno, Flux).
Applicable scenarios:
- Upload a reference image to the CDN to obtain a URL before calling Midjourney
/midjourney/imagine. - Cache the video generated in the previous step for use as input in the next step.
- Temporarily host materials uploaded by users, avoiding the need to build your own S3.
ℹ️ This API is an qiyaov platform management API, with the unified prefix
https://api17.platform.acedata.cloud/api/v1/.
¶ API Overview
| Item | Content |
|---|---|
| Method | POST |
| URL | https://api17.platform.acedata.cloud/api/v1/files/ |
| Authentication | ✅ Account token required |
| Content-Type | multipart/form-data (not JSON) |
¶ Authentication Instructions (How to Obtain an Account Token)
Request header:
Authorization: Bearer ${PLATFORM_TOKEN}
How to obtain it: Log in to the qiyaov Platform → Account Token Console → click the “Create” button. See Manage qiyaov Platform Account Tokens for details.
¶ Request Body (multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
file |
file | ✅ | Binary file stream. The default single-file limit is 100 MB |
¶ Request Examples
¶ cURL
curl -X POST 'https://api17.platform.acedata.cloud/api/v1/files/' \
-H 'accept: application/json' \
-H "authorization: Bearer ${PLATFORM_TOKEN}" \
-F 'file=@./photo.jpg'
¶ Python
import os
import requests
PLATFORM_TOKEN = os.environ["PLATFORM_TOKEN"]
with open("photo.jpg", "rb") as f:
resp = requests.post(
"https://api17.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 use it in other business APIs:
# requests.post("https://api.qiyaov.com/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://api17.platform.acedata.cloud/api/v1/files/', {
method: 'POST',
headers: {
authorization: `Bearer ${process.env.PLATFORM_TOKEN}`,
...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 use the file_url field in other business APIs—the CDN URL is currently publicly accessible and does not require authentication; do not treat it as a permanent archival guarantee.
¶ Response Field Description
| Field | Type | Description |
|---|---|---|
file_url |
string | CDN access URL |
¶ Error Handling
| HTTP | Response Example | Meaning |
|---|---|---|
| 400 | {"error":"No file provided"} |
The file field was not attached or the field name is incorrect |
| 401 | DRF authentication error response | Missing or invalid account token |
| 413 | {"error":"File too large","max_bytes":...} |
The file exceeds 100 MB (default) |
¶ Practical Tips
- Upload images as reference images: Midjourney
image_urls, Fluximage_url, and Veoreference_urlall accept CDN URLs, and do not accept base64. Obtaining a URL through this API first is standard practice. - Do not upload sensitive data: The returned URL is publicly accessible; the retention period is subject to the platform's current storage policy. For long-term archiving, use your own object storage.
- Bulk uploads: Control concurrency and set a timeout for each upload; throughput depends on file size and network environment.
¶ Related APIs
- Get the qiyaov Platform Service List — Find business services that accept URL input
- Create qiyaov Platform API Credentials — After uploading, the next step is usually to create credentials to call business APIs