查询素材详情
curl --request GET \
--url https://xxx.wengaocloud.com/v1/assets/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://xxx.wengaocloud.com/v1/assets/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://xxx.wengaocloud.com/v1/assets/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://xxx.wengaocloud.com/v1/assets/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "asset_6f9a4c2b8d1e3a90",
"uri": "asset://asset_6f9a4c2b8d1e3a90",
"object": "asset",
"asset_type": "image",
"name": "avatar-reference",
"status": "active",
"created_at": 1779782400,
"updated_at": 1779782460
}{
"error": {
"type": "invalid_request_error",
"code": "model_endpoint_mismatch",
"message": "该模型不支持当前 endpoint。"
}
}{
"error": {
"type": "invalid_request_error",
"code": "model_endpoint_mismatch",
"message": "该模型不支持当前 endpoint。"
}
}视频生成
查询素材详情
查询单个素材状态。id 为创建素材返回的 asset_xxx,不要带 asset:// 前缀。
查询素材详情
curl --request GET \
--url https://xxx.wengaocloud.com/v1/assets/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://xxx.wengaocloud.com/v1/assets/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://xxx.wengaocloud.com/v1/assets/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://xxx.wengaocloud.com/v1/assets/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "asset_6f9a4c2b8d1e3a90",
"uri": "asset://asset_6f9a4c2b8d1e3a90",
"object": "asset",
"asset_type": "image",
"name": "avatar-reference",
"status": "active",
"created_at": 1779782400,
"updated_at": 1779782460
}{
"error": {
"type": "invalid_request_error",
"code": "model_endpoint_mismatch",
"message": "该模型不支持当前 endpoint。"
}
}{
"error": {
"type": "invalid_request_error",
"code": "model_endpoint_mismatch",
"message": "该模型不支持当前 endpoint。"
}
}查询单个素材的状态和详细信息。
处理中响应:
可用响应(
GET /v1/assets/{id}
Authorization: Bearer <API_KEY>
id 为创建素材返回的 asset_xxx,不要带 asset:// 前缀。
通常用于轮询素材处理状态,等待 status=active 后再提交视频生成任务。
示例
curl "https://{your-domain}/v1/assets/asset_6f9a4c2b8d1e3a90" \
-H "Authorization: Bearer $API_KEY"
{
"id": "asset_6f9a4c2b8d1e3a90",
"uri": "asset://asset_6f9a4c2b8d1e3a90",
"object": "asset",
"asset_type": "image",
"name": "avatar-reference",
"status": "processing",
"created_at": 1779782400,
"updated_at": 1779782400
}
status=active,可用于视频生成):
{
"id": "asset_6f9a4c2b8d1e3a90",
"uri": "asset://asset_6f9a4c2b8d1e3a90",
"object": "asset",
"asset_type": "image",
"name": "avatar-reference",
"status": "active",
"created_at": 1779782400,
"updated_at": 1779782460
}
素材状态
| 状态 | 说明 | 可用于视频生成 |
|---|---|---|
processing | 平台已受理,正在保存或等待处理。 | 否 |
active | 素材可用。 | 是 |
failed | 素材处理失败。 | 否 |
disabled | 素材已被平台禁用。 | 否 |
错误码
| HTTP 状态码 | error.type | 场景 |
|---|---|---|
| 404 | asset_not_found | 素材不存在、不属于当前用户/域名,或传入了无效素材 ID。 |
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
路径参数
素材 ID,格式为 asset_xxx,不带 asset:// 前缀。
响应
素材详情。
平台素材 ID,格式 asset_xxx。
示例:
"asset_6f9a4c2b8d1e3a90"
素材 URI,格式 asset://asset_xxx,视频生成请求中使用此值。
示例:
"asset://asset_6f9a4c2b8d1e3a90"
可用选项:
asset 可用选项:
image, video, audio 素材状态:processing(处理中,不可用于生成)、active(可用)、
failed(处理失败)、disabled(已禁用)。
可用选项:
processing, active, failed, disabled 平台保存后的素材访问地址,通常为平台 CDN 地址;仅在列表接口传入 include_resource_url=1 且素材类型为图片或视频时返回。
.png?fit=max&auto=format&n=v_sJS-AFS6goKAv3&q=85&s=e03202fddb83c95be2a503ab9c79163a)