获取历史产物列表
Endpoint: GET /v1/storages
返回当前账号的历史产物——临时与持久——按创建时间倒序排列。已删除产物不包含在内。
请求头
| Header | Value | Required | Notes |
|---|---|---|---|
Authorization | Bearer YOUR_API_KEY | yes | 账号 API Key,所有请求必填。 |
查询参数
Request example — GET https://api.hiapi.ai/v1/storages?type=all&page=1&size=20
{}
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | no | all | 按档位筛选:temp、persistent 或 all。其他取值(如 bogus)不会报错,按 all 处理。 |
page | int | no | 1 | 页码,>= 1。 |
size | int | no | 10 | 每页条数,1 ≤ size ≤ 100。 |
服务端归一化:page 小于 1 取 1;size 小于 1 取 10,大于 100 取 100。
响应
{
"code": 200,
"message": "success",
"data": {
"items": [
{
"id": "90217",
"task_id": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"artifact_type": "image",
"storage_tier": "persistent",
"cdn_url": "https://<persistent-cdn-domain>/abcd123456/01HZTQ8BX2-0.png",
"size_bytes": 1843204,
"duration_seconds": 0,
"mime_type": "image/png",
"media_kind": "image",
"download_filename": "01HZTQ8BX2-0.png",
"expire_at": 0,
"promotable": false,
"created_at": 1777282099,
"prompt": "a cyan glass data center entrance"
},
{
"id": "90216",
"task_id": "tk-hiapi-01HZTQ5M0J9W8C2B6N4P1S3D7F",
"artifact_type": "video",
"storage_tier": "temporary",
"cdn_url": "https://cdn.hiapi.ai/abcd123456/01HZTQ5M0J-0.mp4",
"size_bytes": 8421765,
"duration_seconds": 5,
"mime_type": "video/mp4",
"media_kind": "video",
"download_filename": "01HZTQ5M0J-0.mp4",
"expire_at": 1777886899,
"promotable": true,
"created_at": 1777282010,
"prompt": "a cyan glass data center entrance"
}
],
"total": 42,
"page": 1,
"size": 20
}
}
单项字段
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | no | — | 产物 id(字符串,避免大整数精度丢失)。转持久 / 删除时原样传入。 |
task_id | string | no | — | 产出该产物的 /v1/tasks 任务。 |
artifact_type | string | no | — | 产物类型,如 image、video、audio、first_frame、thumbnail。 |
storage_tier | string | no | — | temporary 或 persistent。存储列表只返回这两档,内置素材(static)产物不在列表中。存储列表用这个字段名;任务详情里同一个档位叫 storage(temp / persistent / static)。 |
cdn_url | string | no | — | 公开下载地址。临时与持久产物使用不同的 CDN 域名;转持久会保留路径、切换域名。转持久完成后旧的临时地址不再可用,需要重新获取该条目拿到持久地址。 |
size_bytes | int | no | — | 存储大小(字节)。持久存储按此计费。 |
duration_seconds | float | no | — | 产物时长(秒),仅视频、音频等有时长的产物有值;静态图片为 0。 |
mime_type | string | no | — | 存储文件的 MIME 类型;无法识别时为 application/octet-stream。 |
media_kind | string | no | — | 展示用的粗分类:image、video、audio、caption 或 file。字幕等旁挂产物为 caption。 |
download_filename | string | no | — | 保存文件时建议使用的文件名,由存储对象名推导。 |
expire_at | int | no | — | 临时产物被删除的 Unix 秒;持久产物为 0(不过期)。 |
promotable | bool | no | — | 该产物是否可转为持久。 |
created_at | int | no | — | 产物创建的 Unix 秒。 |
prompt | string | no | — | 产出该产物的任务提示词。没有文字输入的任务(图生图、放大、音频等)为空字符串。返回的是用户原始提示词,属隐私字段,只对产物所属账号返回。 |
用 id 转持久和删除
storage_tier 与 storage 的区别
存储列表用
storage_tier表示档位,取值只有temporary/persistent;static(内置素材)只出现在任务详情的storage里,存储列表不会返回。任务详情里同一个设置叫storage,取值temp/persistent/static。两者描述的是同一个状态,只是字段名和用词不同。