Create asset
Register a publicly accessible image, video, or audio file in an asset group. The initial status is normally Processing; use Asset details to refresh it.
curl --request POST \
--url https://aitoearn.cn/api/ai/volcengine/assets/items \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"groupId": "group_xxx",
"url": "https://assets.example.com/person-reference.jpg",
"assetType": "Image"
}
'import requests
url = "https://aitoearn.cn/api/ai/volcengine/assets/items"
payload = {
"groupId": "group_xxx",
"url": "https://assets.example.com/person-reference.jpg",
"assetType": "Image"
}
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({
groupId: 'group_xxx',
url: 'https://assets.example.com/person-reference.jpg',
assetType: 'Image'
})
};
fetch('https://aitoearn.cn/api/ai/volcengine/assets/items', 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/ai/volcengine/assets/items"
payload := strings.NewReader("{\n \"groupId\": \"group_xxx\",\n \"url\": \"https://assets.example.com/person-reference.jpg\",\n \"assetType\": \"Image\"\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))
}Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Body
Asset group ID. Real-person assets must use the group ID returned after verification.
1Publicly accessible asset source file URL.
Asset type.
Image, Video, Audio Asset name.
1Response
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.
Hide child attributes
Hide child attributes
Asset ID.
Asset group ID.
Asset type.
Image, Video, Audio Asset status. Only Active assets can be used for video generation.
Processing, Active, Failed Created at.
Updated at.
Asset name.
Asset source file URL.
Request ID.
Error response timestamp in Unix milliseconds.
curl --request POST \
--url https://aitoearn.cn/api/ai/volcengine/assets/items \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"groupId": "group_xxx",
"url": "https://assets.example.com/person-reference.jpg",
"assetType": "Image"
}
'import requests
url = "https://aitoearn.cn/api/ai/volcengine/assets/items"
payload = {
"groupId": "group_xxx",
"url": "https://assets.example.com/person-reference.jpg",
"assetType": "Image"
}
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({
groupId: 'group_xxx',
url: 'https://assets.example.com/person-reference.jpg',
assetType: 'Image'
})
};
fetch('https://aitoearn.cn/api/ai/volcengine/assets/items', 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/ai/volcengine/assets/items"
payload := strings.NewReader("{\n \"groupId\": \"group_xxx\",\n \"url\": \"https://assets.example.com/person-reference.jpg\",\n \"assetType\": \"Image\"\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))
}
