查询素材列表
curl --request GET \
--url https://xxx.wengaocloud.com/v1/assets \
--header 'Authorization: Bearer <token>'import requests
url = "https://xxx.wengaocloud.com/v1/assets"
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', 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"
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))
}{
"items": [
{
"id": "asset_6f9a4c2b8d1e3a90",
"uri": "asset://asset_6f9a4c2b8d1e3a90",
"object": "asset",
"asset_type": "image",
"name": "<string>",
"status": "processing",
"resource_url": "<string>",
"created_at": 123,
"updated_at": 123
}
],
"total": 123,
"page": 123,
"page_size": 123
}{
"error": {
"type": "invalid_request_error",
"code": "model_endpoint_mismatch",
"message": "该模型不支持当前 endpoint。"
}
}视频生成
查询素材列表
查询当前 API Key 用户名下的素材列表,支持按状态、类型、名称过滤。默认不返回素材资源 URL;传入 include_resource_url=1 时,图片和视频素材会额外返回平台/CDN 素材 URL。
查询素材列表
curl --request GET \
--url https://xxx.wengaocloud.com/v1/assets \
--header 'Authorization: Bearer <token>'import requests
url = "https://xxx.wengaocloud.com/v1/assets"
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', 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"
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))
}{
"items": [
{
"id": "asset_6f9a4c2b8d1e3a90",
"uri": "asset://asset_6f9a4c2b8d1e3a90",
"object": "asset",
"asset_type": "image",
"name": "<string>",
"status": "processing",
"resource_url": "<string>",
"created_at": 123,
"updated_at": 123
}
],
"total": 123,
"page": 123,
"page_size": 123
}{
"error": {
"type": "invalid_request_error",
"code": "model_endpoint_mismatch",
"message": "该模型不支持当前 endpoint。"
}
}查询当前 API Key 用户名下的素材列表,支持按状态、类型、名称过滤,支持分页。
响应:
GET /v1/assets
Authorization: Bearer <API_KEY>
查询参数
| 参数 | 类型 | 说明 |
|---|---|---|
status | string | 按状态过滤:processing、active、failed。 |
asset_type | string | 按类型过滤:image、video、audio。 |
name | string | 按名称模糊搜索。 |
page | integer | 页码,默认 1。 |
page_size | integer | 每页数量,默认 20,最大 100。 |
include_resource_url | integer/string | 可选。传入 1 时,图片和视频素材会额外返回 resource_url。默认不返回素材资源 URL。 |
示例
curl "https://{your-domain}/v1/assets?asset_type=image&status=active&page=1&page_size=20&include_resource_url=1" \
-H "Authorization: Bearer $API_KEY"
{
"items": [
{
"id": "asset_6f9a4c2b8d1e3a90",
"uri": "asset://asset_6f9a4c2b8d1e3a90",
"object": "asset",
"asset_type": "image",
"name": "avatar-reference",
"status": "active",
"resource_url": "https://cdn.wengaocloud.com/assets/ai/domain_x/user_x/image/example.png",
"created_at": 1779782400,
"updated_at": 1779782460
}
],
"total": 1,
"page": 1,
"page_size": 20
}
resource_url 是平台保存后的素材访问地址,通常为平台 CDN 地址;它不是视频生成请求使用的 asset:// URI。该字段仅在传入 include_resource_url=1 且素材类型为 image 或 video 时返回。
素材状态
| 状态 | 说明 | 可用于视频生成 |
|---|---|---|
processing | 平台已受理,正在保存或等待素材处理。 | 否 |
active | 素材可用。 | 是 |
failed | 素材处理失败。 | 否 |
disabled | 素材已被平台禁用。 | 否 |
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
查询参数
可用选项:
processing, active, failed 可用选项:
image, video, audio 按名称模糊搜索。
必填范围:
x <= 100传入 1 时,图片和视频素材会额外返回 resource_url;默认不返回。
响应
素材列表。
Hide child attributes
Hide child attributes
平台素材 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)