AI 服务/真人素材
创建素材
把公网可访问的图片、视频或音频登记到素材组。创建后状态通常为 Processing,请通过“素材详情”接口刷新状态。
POST
/
api
/
ai
/
volcengine
/
assets
/
items
创建素材
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))
}{
"code": 0,
"message": "请求成功",
"data": {
"assetId": "string",
"groupId": "string",
"assetType": "Image",
"status": "Processing",
"createdAt": "2026-07-02T12:00:00.000Z",
"updatedAt": "2026-07-02T12:00:00.000Z",
"name": "string",
"url": "https://assets.aitoearn.cn/example.png"
}
}
授权
需要从 AiToEarn 获取 API Key。点击前往「API Key 获取教程」。
请求体
application/json
响应
200 - application/json
请求已被服务处理。业务是否成功以响应体 code === 0 为准。
业务状态码。0 表示成功,非 0 表示业务错误。
响应消息。
Hide child attributes
Hide child attributes
素材 ID。
素材组 ID。
素材类型。
可用选项:
Image, Video, Audio 素材状态。只有 Active 状态的素材可以用于视频生成。
可用选项:
Processing, Active, Failed 创建时间。
更新时间。
素材名称。
素材源文件 URL。
请求 ID。
错误响应时间戳,Unix 毫秒。
最后修改于 2026年9月2日
⌘I
创建素材
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))
}{
"code": 0,
"message": "请求成功",
"data": {
"assetId": "string",
"groupId": "string",
"assetType": "Image",
"status": "Processing",
"createdAt": "2026-07-02T12:00:00.000Z",
"updatedAt": "2026-07-02T12:00:00.000Z",
"name": "string",
"url": "https://assets.aitoearn.cn/example.png"
}
}

