素材库
查询素材
GET /v1/assets/ — 查询素材的审核状态
GET
/
v1
/
assets
/
{asset_id}
curl https://api.qingbo.ai/v1/assets/ast_3f9c2a7d1e8b4c6a5f0e9d21 \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
response = requests.get(
"https://api.qingbo.ai/v1/assets/ast_3f9c2a7d1e8b4c6a5f0e9d21",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
asset = response.json()
if asset["status"] == "active":
print(asset["asset_url"])
{
"id": "ast_3f9c2a7d1e8b4c6a5f0e9d21",
"object": "asset",
"model": "seedance-2.5",
"type": "video",
"name": "hero-walk-ref",
"status": "active",
"duration_seconds": 5.062,
"created_at": 1790220525,
"updated_at": 1790220534,
"asset_url": "asset://asset-20260924112839-scjs4"
}
{
"id": "ast_3f9c2a7d1e8b4c6a5f0e9d21",
"object": "asset",
"model": "seedance-2.5",
"type": "video",
"name": "hero-walk-ref",
"status": "failed",
"duration_seconds": 5.062,
"created_at": 1790220525,
"updated_at": 1790220540,
"error": {
"message": "素材分辨率不符合要求:总像素需在 407,696 到 8,295,044 之间"
}
}
{
"error": {
"message": "素材不存在",
"type": "invalid_request_error",
"param": "asset_id",
"code": "asset_not_found"
}
}
查询本账号的一个素材。
status 为 active 时响应带 asset_url,用于生成请求。
curl https://api.qingbo.ai/v1/assets/ast_3f9c2a7d1e8b4c6a5f0e9d21 \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
response = requests.get(
"https://api.qingbo.ai/v1/assets/ast_3f9c2a7d1e8b4c6a5f0e9d21",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
asset = response.json()
if asset["status"] == "active":
print(asset["asset_url"])
{
"id": "ast_3f9c2a7d1e8b4c6a5f0e9d21",
"object": "asset",
"model": "seedance-2.5",
"type": "video",
"name": "hero-walk-ref",
"status": "active",
"duration_seconds": 5.062,
"created_at": 1790220525,
"updated_at": 1790220534,
"asset_url": "asset://asset-20260924112839-scjs4"
}
{
"id": "ast_3f9c2a7d1e8b4c6a5f0e9d21",
"object": "asset",
"model": "seedance-2.5",
"type": "video",
"name": "hero-walk-ref",
"status": "failed",
"duration_seconds": 5.062,
"created_at": 1790220525,
"updated_at": 1790220540,
"error": {
"message": "素材分辨率不符合要求:总像素需在 407,696 到 8,295,044 之间"
}
}
{
"error": {
"message": "素材不存在",
"type": "invalid_request_error",
"param": "asset_id",
"code": "asset_not_found"
}
}
鉴权
请求参数
响应
仅
failed 时返回。message 为失败原因,取值见素材库。错误码
| HTTP | code | 说明 |
|---|---|---|
| 401 | — | API Key 缺失或无效 |
| 404 | asset_not_found | 素材不存在、不属于本账号或已删除 |
| 500 | asset_store_error | 素材记录读取失败,可重试 |
相关文档
⌘I
curl https://api.qingbo.ai/v1/assets/ast_3f9c2a7d1e8b4c6a5f0e9d21 \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
response = requests.get(
"https://api.qingbo.ai/v1/assets/ast_3f9c2a7d1e8b4c6a5f0e9d21",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
asset = response.json()
if asset["status"] == "active":
print(asset["asset_url"])
{
"id": "ast_3f9c2a7d1e8b4c6a5f0e9d21",
"object": "asset",
"model": "seedance-2.5",
"type": "video",
"name": "hero-walk-ref",
"status": "active",
"duration_seconds": 5.062,
"created_at": 1790220525,
"updated_at": 1790220534,
"asset_url": "asset://asset-20260924112839-scjs4"
}
{
"id": "ast_3f9c2a7d1e8b4c6a5f0e9d21",
"object": "asset",
"model": "seedance-2.5",
"type": "video",
"name": "hero-walk-ref",
"status": "failed",
"duration_seconds": 5.062,
"created_at": 1790220525,
"updated_at": 1790220540,
"error": {
"message": "素材分辨率不符合要求:总像素需在 407,696 到 8,295,044 之间"
}
}
{
"error": {
"message": "素材不存在",
"type": "invalid_request_error",
"param": "asset_id",
"code": "asset_not_found"
}
}