Asset Management
Generate Upload Signature
Interface description: Generate a signed URL for direct transfer to object storage, and the upload path is automatically generated based on user and resource type. View the asset upload guide.
POST
/
api
/
assets
/
uploadSign
Generate Upload Signature
curl --request POST \
--url https://aitoearn.cn/api/assets/uploadSign \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"filename": "api-doc-audit.txt"
}
'import requests
url = "https://aitoearn.cn/api/assets/uploadSign"
payload = { "filename": "api-doc-audit.txt" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: 'api-doc-audit.txt'})
};
fetch('https://aitoearn.cn/api/assets/uploadSign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/assets/uploadSign"
payload := strings.NewReader("{\n \"filename\": \"api-doc-audit.txt\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "Request succeeded",
"data": {
"id": "string",
"path": "string",
"url": "string",
"uploadUrl": "string"
},
"requestId": "string"
}Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Body
application/json
File name (with extension)
Resource type
Available options:
aiImage, aiVideo, aiCard, aiChatImage, aideoOutput, videoEdit, dramaRecap, styleTransfer, imageEdit, subtitle, userMedia, userFile, publishMedia, avatar, agentSession, videoThumbnail, googlePlace, brandLibrary, temp File size (bytes)
Response
200 - application/json
The request has been processed by the service. Business success is determined by whether the response body has code === 0.
Business status code. 0 means success; non-zero means a business error.
Response message.
Request ID.
Error response timestamp in Unix milliseconds.
Last modified on September 29, 2026
⌘I
Generate Upload Signature
curl --request POST \
--url https://aitoearn.cn/api/assets/uploadSign \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"filename": "api-doc-audit.txt"
}
'import requests
url = "https://aitoearn.cn/api/assets/uploadSign"
payload = { "filename": "api-doc-audit.txt" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: 'api-doc-audit.txt'})
};
fetch('https://aitoearn.cn/api/assets/uploadSign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/assets/uploadSign"
payload := strings.NewReader("{\n \"filename\": \"api-doc-audit.txt\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "Request succeeded",
"data": {
"id": "string",
"path": "string",
"url": "string",
"uploadUrl": "string"
},
"requestId": "string"
}
