Media API

2026-10-20

Media API

使用 API Key 作为 Bearer 凭据访问素材库。

https://api.deepraxis.ai/media/v1

指南 →

资源参考
素材库素材库
素材素材
理解结果理解结果
检索检索
文件夹文件夹
批量操作批量操作
事件事件

错误码

素材库

指南 →

基础地址与鉴权

创建库

POST /media/v1/libraries

请求体

字段类型必填说明
modelsMediaModelsInput否各角色的模型调用 ID;局部更新,null 恢复默认
namestring是名称,1–64 个字符;允许重名
labelsobject否标签对象;GET 时传 JSON 字符串;PATCH 整体替换,传 {} 清空
understandingobject否视觉、转写与语义理解开关

返回: Library.

响应

HTTP 200

Successful response.

application/json

名称类型说明
searchobjectSearch capabilities of this library’s embedding model.
search.imagebooleanWhether this library’s embedding model supports image-based visual search.
modelsobjectResolved model call IDs used for new uploads and reprocessing.
models.visionstringModel call ID for visual descriptions; the model must support image input.
models.embeddingstringModel call ID for search embeddings; must produce compatible vectors and cannot change while assets exist.
models.transcriptionstringModel call ID for speech transcription.
idstringGenerated library identifier: lib_ followed by 32 lowercase hexadecimal characters.
namestringDisplay name of the library; duplicate names are allowed.
labelsobjectCaller-defined string labels used to organize and filter libraries.
statusstringLibrary lifecycle: provisioning initializes the library; active permits asset operations; deleting awaits purge and may be restored before purge_at; deleted has been purged; failed indicates initialization failure.
asset_countnumberNumber of assets currently stored in the library.
bytesnumberTotal source-content size of the library’s assets, in bytes.
understandingobjectSettings controlling understanding tasks for new uploads.
understanding.visualbooleanEnable captions, tags and OCR for images and video frames.
understanding.transcriptbooleanEnable speech transcription for audio and video soundtracks.
understanding.embeddingbooleanEnable generation of vectors for semantic search.
created_atstringTime the library was created, in UTC.
updated_atstringTime library settings, lifecycle or usage were last updated, in UTC.
deleted_atstring | nullTime the library entered deleting, or null when active or restored.
purge_atstring | nullScheduled purge time while the library is deleting; null for an active or restored library.
curl -X POST "https://api.deepraxis.ai/media/v1/libraries" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name":"walk-lib-r1-MDP-1791733789929","labels":{"sample":"walk-lib-r1-MDP-1791733789929"}}'

HTTP 200

{
  "id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "name": "walk-lib-r1-MDP-1791733789929",
  "labels": {
    "sample": "walk-lib-r1-MDP-1791733789929"
  },
  "status": "active",
  "asset_count": 0,
  "bytes": 0,
  "models": {
    "vision": "qwen3.8-flash",
    "embedding": "qwen3-vl-embedding",
    "transcription": "whisper-large-v3-turbo"
  },
  "search": {
    "image": true
  },
  "understanding": {
    "visual": true,
    "transcript": true,
    "embedding": true
  },
  "created_at": "2026-10-11T15:50:04.230Z",
  "updated_at": "2026-10-11T15:50:04.931Z",
  "deleted_at": null,
  "purge_at": null
}

列出库

GET /media/v1/libraries

参数位置类型说明
cursorquerystring上一页的 next_cursor
limitqueryinteger每页 1–200 条,默认 50
labelsquerystring标签对象;GET 时传 JSON 字符串;PATCH 整体替换,传 {} 清空
statusqueryactive / deleting资源状态

返回: LibraryPage.

响应

HTTP 200

Successful response.

application/json

名称类型说明
dataarray<object>Libraries in this page, ordered by creation time descending.
data[].searchobjectSearch capabilities of this library’s embedding model.
data[].modelsobjectResolved model call IDs used for new uploads and reprocessing.
data[].idstringGenerated library identifier: lib_ followed by 32 lowercase hexadecimal characters.
data[].namestringDisplay name of the library; duplicate names are allowed.
data[].labelsobjectCaller-defined string labels used to organize and filter libraries.
data[].statusstringLibrary lifecycle: provisioning initializes the library; active permits asset operations; deleting awaits purge and may be restored before purge_at; deleted has been purged; failed indicates initialization failure.
data[].asset_countnumberNumber of assets currently stored in the library.
data[].bytesnumberTotal source-content size of the library’s assets, in bytes.
data[].understandingobjectSettings controlling understanding tasks for new uploads.
data[].created_atstringTime the library was created, in UTC.
data[].updated_atstringTime library settings, lifecycle or usage were last updated, in UTC.
data[].deleted_atstring | nullTime the library entered deleting, or null when active or restored.
data[].purge_atstring | nullScheduled purge time while the library is deleting; null for an active or restored library.
next_cursorstring | nullOpaque token to pass as cursor to listLibraries; null means no further page.
curl -X GET "https://api.deepraxis.ai/media/v1/libraries?labels=%7B%22sample%22%3A%22walk-lib-r1-MDP-1791733789929%22%7D" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

HTTP 200

{
  "data": [
    {
      "id": "lib_d3881a2f54a34cd79121b9d659e8378c",
      "name": "walk-lib-r1-MDP-1791733789929",
      "status": "active",
      "asset_count": 0,
      "bytes": 0,
      "created_at": "2026-10-11T15:50:04.230Z",
      "updated_at": "2026-10-11T15:50:04.931Z",
      "deleted_at": null,
      "purge_at": null,
      "search": {
        "image": true
      },
      "models": {
        "vision": "qwen3.8-flash",
        "embedding": "qwen3-vl-embedding",
        "transcription": "whisper-large-v3-turbo"
      },
      "labels": {
        "sample": "walk-lib-r1-MDP-1791733789929"
      },
      "understanding": {
        "visual": true,
        "transcript": true,
        "embedding": true
      }
    }
  ],
  "next_cursor": null
}

读取库

GET /media/v1/libraries/{library_id}

参数位置类型说明
library_idpathstring库 ID

返回: Library.

响应

HTTP 200

Successful response.

application/json

名称类型说明
searchobjectSearch capabilities of this library’s embedding model.
search.imagebooleanWhether this library’s embedding model supports image-based visual search.
modelsobjectResolved model call IDs used for new uploads and reprocessing.
models.visionstringModel call ID for visual descriptions; the model must support image input.
models.embeddingstringModel call ID for search embeddings; must produce compatible vectors and cannot change while assets exist.
models.transcriptionstringModel call ID for speech transcription.
idstringGenerated library identifier: lib_ followed by 32 lowercase hexadecimal characters.
namestringDisplay name of the library; duplicate names are allowed.
labelsobjectCaller-defined string labels used to organize and filter libraries.
statusstringLibrary lifecycle: provisioning initializes the library; active permits asset operations; deleting awaits purge and may be restored before purge_at; deleted has been purged; failed indicates initialization failure.
asset_countnumberNumber of assets currently stored in the library.
bytesnumberTotal source-content size of the library’s assets, in bytes.
understandingobjectSettings controlling understanding tasks for new uploads.
understanding.visualbooleanEnable captions, tags and OCR for images and video frames.
understanding.transcriptbooleanEnable speech transcription for audio and video soundtracks.
understanding.embeddingbooleanEnable generation of vectors for semantic search.
created_atstringTime the library was created, in UTC.
updated_atstringTime library settings, lifecycle or usage were last updated, in UTC.
deleted_atstring | nullTime the library entered deleting, or null when active or restored.
purge_atstring | nullScheduled purge time while the library is deleting; null for an active or restored library.
curl -X GET "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

HTTP 200

{
  "id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "name": "walk-lib-r1-MDP-1791733789929",
  "status": "active",
  "asset_count": 0,
  "bytes": 0,
  "created_at": "2026-10-11T15:50:04.230Z",
  "updated_at": "2026-10-11T15:50:04.931Z",
  "deleted_at": null,
  "purge_at": null,
  "search": {
    "image": true
  },
  "models": {
    "vision": "qwen3.8-flash",
    "embedding": "qwen3-vl-embedding",
    "transcription": "whisper-large-v3-turbo"
  },
  "labels": {
    "sample": "walk-lib-r1-MDP-1791733789929"
  },
  "understanding": {
    "visual": true,
    "transcript": true,
    "embedding": true
  }
}

更新库

PATCH /media/v1/libraries/{library_id}

参数位置类型说明
library_idpathstring库 ID

请求体

字段类型必填说明
modelsMediaModelsInput否各角色的模型调用 ID;局部更新,null 恢复默认
namestring否名称,1–64 个字符;允许重名
labelsobject否标签对象;GET 时传 JSON 字符串;PATCH 整体替换,传 {} 清空
understandingobject否视觉、转写与语义理解开关

返回: Library.

响应

HTTP 200

Successful response.

application/json

名称类型说明
searchobjectSearch capabilities of this library’s embedding model.
search.imagebooleanWhether this library’s embedding model supports image-based visual search.
modelsobjectResolved model call IDs used for new uploads and reprocessing.
models.visionstringModel call ID for visual descriptions; the model must support image input.
models.embeddingstringModel call ID for search embeddings; must produce compatible vectors and cannot change while assets exist.
models.transcriptionstringModel call ID for speech transcription.
idstringGenerated library identifier: lib_ followed by 32 lowercase hexadecimal characters.
namestringDisplay name of the library; duplicate names are allowed.
labelsobjectCaller-defined string labels used to organize and filter libraries.
statusstringLibrary lifecycle: provisioning initializes the library; active permits asset operations; deleting awaits purge and may be restored before purge_at; deleted has been purged; failed indicates initialization failure.
asset_countnumberNumber of assets currently stored in the library.
bytesnumberTotal source-content size of the library’s assets, in bytes.
understandingobjectSettings controlling understanding tasks for new uploads.
understanding.visualbooleanEnable captions, tags and OCR for images and video frames.
understanding.transcriptbooleanEnable speech transcription for audio and video soundtracks.
understanding.embeddingbooleanEnable generation of vectors for semantic search.
created_atstringTime the library was created, in UTC.
updated_atstringTime library settings, lifecycle or usage were last updated, in UTC.
deleted_atstring | nullTime the library entered deleting, or null when active or restored.
purge_atstring | nullScheduled purge time while the library is deleting; null for an active or restored library.
curl -X PATCH "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name":"walk-lib-r1-MDP-1791733789929-updated"}'

HTTP 200

{
  "id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "name": "walk-lib-r1-MDP-1791733789929-updated",
  "status": "active",
  "asset_count": 0,
  "bytes": 0,
  "created_at": "2026-10-11T15:50:04.230Z",
  "updated_at": "2026-10-11T15:50:07.147Z",
  "deleted_at": null,
  "purge_at": null,
  "search": {
    "image": true
  },
  "models": {
    "vision": "qwen3.8-flash",
    "embedding": "qwen3-vl-embedding",
    "transcription": "whisper-large-v3-turbo"
  },
  "labels": {
    "sample": "walk-lib-r1-MDP-1791733789929"
  },
  "understanding": {
    "visual": true,
    "transcript": true,
    "embedding": true
  }
}

删除库

DELETE /media/v1/libraries/{library_id}

参数位置类型说明
library_idpathstring库 ID

返回: Library.

响应

HTTP 200

Successful response.

application/json

名称类型说明
searchobjectSearch capabilities of this library’s embedding model.
search.imagebooleanWhether this library’s embedding model supports image-based visual search.
modelsobjectResolved model call IDs used for new uploads and reprocessing.
models.visionstringModel call ID for visual descriptions; the model must support image input.
models.embeddingstringModel call ID for search embeddings; must produce compatible vectors and cannot change while assets exist.
models.transcriptionstringModel call ID for speech transcription.
idstringGenerated library identifier: lib_ followed by 32 lowercase hexadecimal characters.
namestringDisplay name of the library; duplicate names are allowed.
labelsobjectCaller-defined string labels used to organize and filter libraries.
statusstringLibrary lifecycle: provisioning initializes the library; active permits asset operations; deleting awaits purge and may be restored before purge_at; deleted has been purged; failed indicates initialization failure.
asset_countnumberNumber of assets currently stored in the library.
bytesnumberTotal source-content size of the library’s assets, in bytes.
understandingobjectSettings controlling understanding tasks for new uploads.
understanding.visualbooleanEnable captions, tags and OCR for images and video frames.
understanding.transcriptbooleanEnable speech transcription for audio and video soundtracks.
understanding.embeddingbooleanEnable generation of vectors for semantic search.
created_atstringTime the library was created, in UTC.
updated_atstringTime library settings, lifecycle or usage were last updated, in UTC.
deleted_atstring | nullTime the library entered deleting, or null when active or restored.
purge_atstring | nullScheduled purge time while the library is deleting; null for an active or restored library.
curl -X DELETE "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

HTTP 200

{
  "id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "name": "walk-lib-r1-MDP-1791733789929-updated",
  "status": "deleting",
  "asset_count": 2,
  "bytes": 140,
  "created_at": "2026-10-11T15:50:04.230Z",
  "updated_at": "2026-10-11T15:50:30.664Z",
  "deleted_at": "2026-10-11T15:50:30.664Z",
  "purge_at": "2026-10-18T15:50:30.664Z",
  "search": {
    "image": true
  },
  "models": {
    "vision": "qwen3.8-flash",
    "embedding": "qwen3-vl-embedding",
    "transcription": "whisper-large-v3-turbo"
  },
  "labels": {
    "sample": "walk-lib-r1-MDP-1791733789929"
  },
  "understanding": {
    "visual": true,
    "transcript": true,
    "embedding": true
  }
}

恢复库

POST /media/v1/libraries/{library_id}/restore

参数位置类型说明
library_idpathstring库 ID

返回: Library.

响应

HTTP 200

Successful response.

application/json

名称类型说明
searchobjectSearch capabilities of this library’s embedding model.
search.imagebooleanWhether this library’s embedding model supports image-based visual search.
modelsobjectResolved model call IDs used for new uploads and reprocessing.
models.visionstringModel call ID for visual descriptions; the model must support image input.
models.embeddingstringModel call ID for search embeddings; must produce compatible vectors and cannot change while assets exist.
models.transcriptionstringModel call ID for speech transcription.
idstringGenerated library identifier: lib_ followed by 32 lowercase hexadecimal characters.
namestringDisplay name of the library; duplicate names are allowed.
labelsobjectCaller-defined string labels used to organize and filter libraries.
statusstringLibrary lifecycle: provisioning initializes the library; active permits asset operations; deleting awaits purge and may be restored before purge_at; deleted has been purged; failed indicates initialization failure.
asset_countnumberNumber of assets currently stored in the library.
bytesnumberTotal source-content size of the library’s assets, in bytes.
understandingobjectSettings controlling understanding tasks for new uploads.
understanding.visualbooleanEnable captions, tags and OCR for images and video frames.
understanding.transcriptbooleanEnable speech transcription for audio and video soundtracks.
understanding.embeddingbooleanEnable generation of vectors for semantic search.
created_atstringTime the library was created, in UTC.
updated_atstringTime library settings, lifecycle or usage were last updated, in UTC.
deleted_atstring | nullTime the library entered deleting, or null when active or restored.
purge_atstring | nullScheduled purge time while the library is deleting; null for an active or restored library.
curl -X POST "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/restore" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{}'

HTTP 200

{
  "id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "name": "walk-lib-r1-MDP-1791733789929-updated",
  "status": "active",
  "asset_count": 2,
  "bytes": 140,
  "created_at": "2026-10-11T15:50:04.230Z",
  "updated_at": "2026-10-11T15:50:31.379Z",
  "deleted_at": null,
  "purge_at": null,
  "search": {
    "image": true
  },
  "models": {
    "vision": "qwen3.8-flash",
    "embedding": "qwen3-vl-embedding",
    "transcription": "whisper-large-v3-turbo"
  },
  "labels": {
    "sample": "walk-lib-r1-MDP-1791733789929"
  },
  "understanding": {
    "visual": true,
    "transcript": true,
    "embedding": true
  }
}

立即清除库

POST /media/v1/libraries/{library_id}/purge

参数位置类型说明
library_idpathstring库 ID

返回: PurgedLibrary.

响应

HTTP 200

Successful response.

application/json

名称类型说明
idstringIdentifier of the library that was permanently purged.
objectstringResource discriminator identifying a library receipt.
purgedbooleanTrue when permanent library cleanup has completed.
curl -X POST "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/purge" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{}'

HTTP 200

{
  "id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "object": "library",
  "purged": true
}

Library

字段类型必填说明
searchobject是检索能力;search.image 为 true 时支持以图搜图
modelsMediaModels是各角色的模型调用 ID;局部更新,null 恢复默认
idLibraryId是资源 ID
namestring是名称,1–64 个字符;允许重名
labelsobject是标签对象;GET 时传 JSON 字符串;PATCH 整体替换,传 {} 清空
statusLibraryStatus是资源状态
asset_countnumber是素材数量
bytesnumber是文件字节数
understandingUnderstandingSettings是视觉、转写与语义理解开关
created_atIsoTimestamp是创建时间
updated_atIsoTimestamp是更新时间
deleted_atIsoTimestamp / null是删除时间;未删除为 null
purge_atIsoTimestamp / null是恢复截止时间

LibraryPage

字段类型必填说明
dataLibrary[]是本页结果
next_cursorstring / null是下一页游标;没有时为 null 或省略

PurgedLibrary

字段类型必填说明
idLibraryId是资源 ID
object"library"是—
purgedtrue是—

Page

字段类型必填说明
dataJSON[]是本页结果
next_cursorstring / null是下一页游标;没有时为 null 或省略

UnderstandingSettings

字段类型必填说明
visualboolean是视觉理解开关
transcriptboolean是转写开关
embeddingboolean是语义理解开关

模型角色

models 指定三个角色使用的模型调用 ID(callModelId)。创建库时省略它会使用下表默认值;更新时只改传入的角色,未传的角色保持不变。某个角色传 null 恢复该角色默认值,models: null 恢复全部默认值。

角色用途默认值
vision图片与视频帧的视觉理解qwen3.8-flash
embedding将内容和检索查询生成向量,用于语义检索qwen3-vl-embedding
transcription音频转写whisper-large-v3-turbo

写入时查询模型目录,校验传入的模型调用 ID。模型不存在返回 400 INVALID_PARAMS,消息为 Model <id> is not available;目录查询失败返回 502 UPSTREAM_FAILED。vision 必须支持图片输入,否则返回 400 INVALID_PARAMS。未知角色、空白 ID 或不合法的值也返回 400。

库中已有素材时不能更换 embedding,返回 409 LIBRARY_INVALID_STATE,消息为「库中已有素材时不能更换嵌入模型」。同一个向量空间必须由同一个模型生成,才能比较已有素材与查询向量;恢复默认值如果改变了 embedding,也受此限制。

修改 vision 或 transcription 只对新上传或重新处理(reprocess)的素材生效,不会自动重跑已有素材。reprocess 不带 kinds 时只重试失败项;显式指定 kinds 时,会强制重跑所选的已成功、失败或不支持项并替换结果。例如,修改 vision 后传入 { kinds: ["visual"] },修改 transcription 后传入 { kinds: ["transcript"] }。

以下 PATCH 只将 vision 恢复默认,保留其他角色:

curl -X PATCH "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"models":{"vision":null}}'

新建库默认使用 qwen3-vl-embedding,支持以图搜图;旧库保留 bge-m3。只读字段 search.image 表示当前库是否支持以图搜图。选择其他模型时,会验证它能否输出 1024 维向量;无法输出则返回 INVALID_PARAMS,探测不可用或缺少调用者身份返回 UPSTREAM_FAILED。

素材

指南 →

基础地址与鉴权

列出素材

GET /media/v1/libraries/{library_id}/assets

参数位置类型说明
library_idpathstring库 ID
asset_folderquerystring组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根
resource_typequeryimage / video / rawimage、video(含音频)或 raw;auto 只用于上传,列表传 auto 或其他值返回 400
cursorquerystring上一页的 next_cursor
limitqueryinteger每页 1–200 条,默认 50

返回: AssetPage.

响应

HTTP 200

Successful response.

application/json

名称类型说明
dataarray<object>Assets in this page, ordered by creation time descending.
data[].asset_idstringGenerated asset identifier: 32 lowercase hexadecimal characters, preserved across overwrites.
data[].public_idstringDelivery identifier unique within this library, used in asset URLs.
data[].display_namestringHuman-readable asset name, independent of its delivery identifier.
data[].asset_folderstringOrganizational folder path; the empty string denotes the root folder.
data[].resource_typestringStored media category: image for images, video for video or audio, and raw for other files. Upload also accepts auto for detection.
data[].typestringPublic asset delivery mode; upload is the only supported value.
data[].formatstringDetected file format used as the delivery URL extension.
data[].versionnumberMonotonically increasing asset version used in delivery URLs; based on upload time in Unix seconds and advanced on overwrite.
data[].version_idstringIdentifier for this asset version, regenerated on overwrite.
data[].bytesnumberSize of the original source content, in bytes.
data[].etagstringMD5 digest of the source bytes, as 32 lowercase hexadecimal characters.
data[].widthnumberSource image or video width in pixels, when known.
data[].heightnumberSource image or video height in pixels, when known.
data[].durationnumberSource audio or video duration in seconds, when known.
data[].pagesnumber
data[].is_audiobooleanTrue for audio-only media, which uses resource_type video.
data[].original_filenamestringOriginal or overridden source filename with its final extension removed.
data[].tagsarray<string>Labels attached to the asset.
data[].contextobjectCustom string metadata; omitted when empty or excluded by the search projection.
data[].created_atstringTime this asset identity was created, in UTC.
data[].urlstringURL for retrieving this version of the asset’s original content.
data[].secure_urlstringHTTPS delivery URL for this asset version; equal to url.
data[].placeholderbooleanFalse because this response represents stored source content.
data[].existingboolean
data[].processingobjectProgress of understanding and embedding tasks for the asset.
data[].library_idstringIdentifier of the library containing this asset.
data[].sha256stringSHA-256 digest of the source bytes, as 64 lowercase hexadecimal characters.
data[].statusstringResource status; active identifies an asset that has not been deleted.
data[].semanticstringSearch-vector status: pending awaits vector generation or reprocessing; ready has searchable vectors; unavailable indicates disabled, unsupported or failed embedding. Existing vectors may still serve searches while reprocessing is pending.
data[].previewobjectGenerated video previews, present once preview generation succeeds.
next_cursorstring | nullOpaque token to pass as cursor to listAssets; null means no further page.
curl -X GET "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/assets" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

HTTP 200

{
  "data": [
    {
      "asset_id": "9dfa312ef9bc4b00816339b598b1152c",
      "public_id": "walk-lib-r1-MDP-1791733789929-tagged",
      "display_name": "walk-lib-r1-MDP-1791733789929-tagged",
      "asset_folder": "",
      "resource_type": "image",
      "type": "upload",
      "format": "png",
      "version": 1791733815,
      "version_id": "26cb8171caa5431b8373ad417fd71e32",
      "bytes": 70,
      "etag": "b357a19c87624c7c4d131aeeb4ae677f",
      "width": 1,
      "height": 1,
      "original_filename": "file",
      "tags": [
        "docs"
      ],
      "processing": {
        "state": "processing",
        "kinds": {
          "embedding": "pending",
          "visual": "running",
          "tagging": "running"
        },
        "updated_at": "2026-10-11T15:50:17.571Z"
      },
      "created_at": "2026-10-11T15:50:15.996Z",
      "url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733815/walk-lib-r1-MDP-1791733789929-tagged.png",
      "secure_url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733815/walk-lib-r1-MDP-1791733789929-tagged.png",
      "placeholder": false,
      "library_id": "lib_d3881a2f54a34cd79121b9d659e8378c",
      "sha256": "497790947d4666760ce38f3c00e852c71fdb66cae849bae8e9ede352719e1581",
      "status": "active",
      "semantic": "pending"
    },
    {
      "asset_id": "85b7ef616a8b4719a41777a036ebc1d2",
      "public_id": "walk-lib-r1-MDP-1791733789929-plain",
      "display_name": "walk-lib-r1-MDP-1791733789929-plain",
      "asset_folder": "",
      "resource_type": "image",
      "type": "upload",
      "format": "png",
      "version": 1791733810,
      "version_id": "fdf3c8cd40c2424d86e8397425a69857",
      "bytes": 70,
      "etag": "b357a19c87624c7c4d131aeeb4ae677f",
      "width": 1,
      "height": 1,
      "original_filename": "file",
      "tags": [
        "docs"
      ],
      "created_at": "2026-10-11T15:50:10.842Z",
      "url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733810/walk-lib-r1-MDP-1791733789929-plain.png",
      "secure_url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733810/walk-lib-r1-MDP-1791733789929-plain.png",
      "placeholder": false,
      "library_id": "lib_d3881a2f54a34cd79121b9d659e8378c",
      "sha256": "497790947d4666760ce38f3c00e852c71fdb66cae849bae8e9ede352719e1581",
      "status": "active",
      "processing": {
        "state": "processing",
        "kinds": {
          "embedding": "pending",
          "visual": "running"
        },
        "updated_at": "2026-10-11T15:50:17.571Z"
      },
      "semantic": "pending"
    }
  ],
  "next_cursor": null
}

上传素材

POST /media/v1/libraries/{library_id}/assets

参数位置类型说明
library_idpathstring库 ID
X-Unique-Upload-Idheaderstring—
Content-Rangeheaderstring—

请求体

字段类型必填说明
filestring / string是文件字节、HTTPS URL、data URI 或同账户 file_…
public_idstring否交付地址中的素材名称,可带路径
public_id_prefixstring否public_id 的路径前缀;末尾的 / 可有可无,前缀与 ID 之间只保留一个 /
display_namestring否显示名称
asset_folderstring否组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根
use_filenameboolean否用文件名生成 public_id
unique_filenameboolean否自动附加唯一后缀
use_filename_as_display_nameboolean否用文件名作为显示名称
filename_overridestring否覆盖原文件名称
overwriteboolean否是否覆盖同名素材
tagsstring / string[]否素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换
contextstring / object否自定义文字键值;PATCH 整体替换,传 {} 清空
auto_taggingnumber否理解后将达到阈值的标签合并;0–1
resource_typeimage / video / raw / auto否image、video(含音频)或 raw;auto 只用于上传,列表传 auto 或其他值返回 400

返回: CloudinaryResource.

响应

HTTP 200

Successful response.

application/json

名称类型说明
asset_idstringGenerated asset identifier: 32 lowercase hexadecimal characters, preserved across overwrites.
public_idstringDelivery identifier unique within this library, used in asset URLs.
display_namestringHuman-readable asset name, independent of its delivery identifier.
asset_folderstringOrganizational folder path; the empty string denotes the root folder.
resource_typestringStored media category: image for images, video for video or audio, and raw for other files. Upload also accepts auto for detection.
typestringPublic asset delivery mode; upload is the only supported value.
formatstringDetected file format used as the delivery URL extension.
versionnumberMonotonically increasing asset version used in delivery URLs; based on upload time in Unix seconds and advanced on overwrite.
version_idstringIdentifier for this asset version, regenerated on overwrite.
bytesnumberSize of the original source content, in bytes.
etagstringMD5 digest of the source bytes, as 32 lowercase hexadecimal characters.
widthnumberSource image or video width in pixels, when known.
heightnumberSource image or video height in pixels, when known.
durationnumberSource audio or video duration in seconds, when known.
pagesnumber
is_audiobooleanTrue for audio-only media, which uses resource_type video.
original_filenamestringOriginal or overridden source filename with its final extension removed.
tagsarray<string>Labels attached to the asset.
contextobjectCustom string metadata; omitted when empty or excluded by the search projection.
context.customobjectCaller-supplied metadata entries with string values.
created_atstringTime this asset identity was created, in UTC.
urlstringURL for retrieving this version of the asset’s original content.
secure_urlstringHTTPS delivery URL for this asset version; equal to url.
placeholderbooleanFalse because this response represents stored source content.
existingbooleanTrue when overwrite=false returns the asset already stored under the requested public_id.
processingobjectProcessing progress, included when auto_tagging was requested.
processing.statestring
processing.kindsobjectProcessing states by kind. tagging is present when auto_tagging was requested and follows visual understanding.
processing.updated_atstringTime the processing state was last updated, in UTC.
donebooleanFalse while more chunks are needed before the asset is complete. / True when the final chunk has completed the asset upload.
upload_idstringUpload session identifier supplied in X-Unique-Upload-Id; reuse it for subsequent chunks.
curl -X POST "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/assets" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"file":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==","public_id":"walk-lib-r1-MDP-1791733789929-tagged","tags":["docs"],"auto_tagging":0.6}'

HTTP 200

{
  "asset_id": "9dfa312ef9bc4b00816339b598b1152c",
  "public_id": "walk-lib-r1-MDP-1791733789929-tagged",
  "display_name": "walk-lib-r1-MDP-1791733789929-tagged",
  "asset_folder": "",
  "resource_type": "image",
  "type": "upload",
  "format": "png",
  "version": 1791733815,
  "version_id": "26cb8171caa5431b8373ad417fd71e32",
  "bytes": 70,
  "etag": "b357a19c87624c7c4d131aeeb4ae677f",
  "width": 1,
  "height": 1,
  "original_filename": "file",
  "tags": [
    "docs"
  ],
  "processing": {
    "state": "pending",
    "kinds": {
      "visual": "pending",
      "embedding": "pending",
      "tagging": "pending"
    },
    "updated_at": "2026-10-11T15:50:15.996Z"
  },
  "created_at": "2026-10-11T15:50:15.996Z",
  "url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733815/walk-lib-r1-MDP-1791733789929-tagged.png",
  "secure_url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733815/walk-lib-r1-MDP-1791733789929-tagged.png",
  "placeholder": false
}

导入文件

POST /media/v1/libraries/{library_id}/assets/import

参数位置类型说明
library_idpathstring库 ID

请求体

字段类型必填说明
file_idstring是同账户文件 ID
public_idstring否交付地址中的素材名称,可带路径
public_id_prefixstring否public_id 的路径前缀;末尾的 / 可有可无,前缀与 ID 之间只保留一个 /
display_namestring否显示名称
asset_folderstring否组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根
use_filenameboolean否用文件名生成 public_id
unique_filenameboolean否自动附加唯一后缀
use_filename_as_display_nameboolean否用文件名作为显示名称
filename_overridestring否覆盖原文件名称
overwriteboolean否是否覆盖同名素材
tagsstring / string[]否素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换
contextstring / object否自定义文字键值;PATCH 整体替换,传 {} 清空
auto_taggingnumber否理解后将达到阈值的标签合并;0–1
resource_typeimage / video / raw / auto否image、video(含音频)或 raw;auto 只用于上传,列表传 auto 或其他值返回 400

返回: Asset.

响应

HTTP 200

Successful response.

application/json

名称类型说明
asset_idstringGenerated asset identifier: 32 lowercase hexadecimal characters, preserved across overwrites.
public_idstringDelivery identifier unique within this library, used in asset URLs.
display_namestringHuman-readable asset name, independent of its delivery identifier.
asset_folderstringOrganizational folder path; the empty string denotes the root folder.
resource_typestringStored media category: image for images, video for video or audio, and raw for other files. Upload also accepts auto for detection.
typestringPublic asset delivery mode; upload is the only supported value.
formatstringDetected file format used as the delivery URL extension.
versionnumberMonotonically increasing asset version used in delivery URLs; based on upload time in Unix seconds and advanced on overwrite.
version_idstringIdentifier for this asset version, regenerated on overwrite.
bytesnumberSize of the original source content, in bytes.
etagstringMD5 digest of the source bytes, as 32 lowercase hexadecimal characters.
widthnumberSource image or video width in pixels, when known.
heightnumberSource image or video height in pixels, when known.
durationnumberSource audio or video duration in seconds, when known.
pagesnumber
is_audiobooleanTrue for audio-only media, which uses resource_type video.
original_filenamestringOriginal or overridden source filename with its final extension removed.
tagsarray<string>Labels attached to the asset.
contextobjectCustom string metadata; omitted when empty or excluded by the search projection.
context.customobjectCaller-supplied metadata entries with string values.
created_atstringTime this asset identity was created, in UTC.
urlstringURL for retrieving this version of the asset’s original content.
secure_urlstringHTTPS delivery URL for this asset version; equal to url.
placeholderbooleanFalse because this response represents stored source content.
existingboolean
processingobjectProgress of understanding and embedding tasks for the asset.
processing.statestring
processing.kindsobjectProcessing states by kind. tagging is present when auto_tagging was requested and follows visual understanding.
processing.updated_atstringTime the processing state was last updated, in UTC.
library_idstringIdentifier of the library containing this asset.
sha256stringSHA-256 digest of the source bytes, as 64 lowercase hexadecimal characters.
statusstringResource status; active identifies an asset that has not been deleted.
semanticstringSearch-vector status: pending awaits vector generation or reprocessing; ready has searchable vectors; unavailable indicates disabled, unsupported or failed embedding. Existing vectors may still serve searches while reprocessing is pending.
previewobjectGenerated video previews, present once preview generation succeeds.
preview.poster_urlstringDelivery URL of the video’s first-frame poster.
preview.storyboardobjectPreview sprite sheet with tile dimensions and sample spacing.

读取素材

GET /media/v1/libraries/{library_id}/assets/{asset_id}

参数位置类型说明
library_idpathstring库 ID
asset_idpathstring素材 ID

返回: Asset.

响应

HTTP 200

Successful response.

application/json

名称类型说明
asset_idstringGenerated asset identifier: 32 lowercase hexadecimal characters, preserved across overwrites.
public_idstringDelivery identifier unique within this library, used in asset URLs.
display_namestringHuman-readable asset name, independent of its delivery identifier.
asset_folderstringOrganizational folder path; the empty string denotes the root folder.
resource_typestringStored media category: image for images, video for video or audio, and raw for other files. Upload also accepts auto for detection.
typestringPublic asset delivery mode; upload is the only supported value.
formatstringDetected file format used as the delivery URL extension.
versionnumberMonotonically increasing asset version used in delivery URLs; based on upload time in Unix seconds and advanced on overwrite.
version_idstringIdentifier for this asset version, regenerated on overwrite.
bytesnumberSize of the original source content, in bytes.
etagstringMD5 digest of the source bytes, as 32 lowercase hexadecimal characters.
widthnumberSource image or video width in pixels, when known.
heightnumberSource image or video height in pixels, when known.
durationnumberSource audio or video duration in seconds, when known.
pagesnumber
is_audiobooleanTrue for audio-only media, which uses resource_type video.
original_filenamestringOriginal or overridden source filename with its final extension removed.
tagsarray<string>Labels attached to the asset.
contextobjectCustom string metadata; omitted when empty or excluded by the search projection.
context.customobjectCaller-supplied metadata entries with string values.
created_atstringTime this asset identity was created, in UTC.
urlstringURL for retrieving this version of the asset’s original content.
secure_urlstringHTTPS delivery URL for this asset version; equal to url.
placeholderbooleanFalse because this response represents stored source content.
existingboolean
processingobjectProgress of understanding and embedding tasks for the asset.
processing.statestring
processing.kindsobjectProcessing states by kind. tagging is present when auto_tagging was requested and follows visual understanding.
processing.updated_atstringTime the processing state was last updated, in UTC.
library_idstringIdentifier of the library containing this asset.
sha256stringSHA-256 digest of the source bytes, as 64 lowercase hexadecimal characters.
statusstringResource status; active identifies an asset that has not been deleted.
semanticstringSearch-vector status: pending awaits vector generation or reprocessing; ready has searchable vectors; unavailable indicates disabled, unsupported or failed embedding. Existing vectors may still serve searches while reprocessing is pending.
previewobjectGenerated video previews, present once preview generation succeeds.
preview.poster_urlstringDelivery URL of the video’s first-frame poster.
preview.storyboardobjectPreview sprite sheet with tile dimensions and sample spacing.
curl -X GET "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/assets/85b7ef616a8b4719a41777a036ebc1d2" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

HTTP 200

{
  "asset_id": "85b7ef616a8b4719a41777a036ebc1d2",
  "public_id": "walk-lib-r1-MDP-1791733789929-plain",
  "display_name": "walk-lib-r1-MDP-1791733789929-plain",
  "asset_folder": "",
  "resource_type": "image",
  "type": "upload",
  "format": "png",
  "version": 1791733810,
  "version_id": "fdf3c8cd40c2424d86e8397425a69857",
  "bytes": 70,
  "etag": "b357a19c87624c7c4d131aeeb4ae677f",
  "width": 1,
  "height": 1,
  "original_filename": "file",
  "tags": [
    "docs"
  ],
  "created_at": "2026-10-11T15:50:10.842Z",
  "url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733810/walk-lib-r1-MDP-1791733789929-plain.png",
  "secure_url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733810/walk-lib-r1-MDP-1791733789929-plain.png",
  "placeholder": false,
  "library_id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "sha256": "497790947d4666760ce38f3c00e852c71fdb66cae849bae8e9ede352719e1581",
  "status": "active",
  "processing": {
    "state": "processing",
    "kinds": {
      "embedding": "pending",
      "visual": "running"
    },
    "updated_at": "2026-10-11T15:50:17.571Z"
  },
  "semantic": "pending"
}

更新素材

PATCH /media/v1/libraries/{library_id}/assets/{asset_id}

参数位置类型说明
library_idpathstring库 ID
asset_idpathstring素材 ID

请求体

字段类型必填说明
display_namestring否显示名称
asset_folderstring否组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根
tagsstring[]否素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换
contextobject否自定义文字键值;PATCH 整体替换,传 {} 清空

返回: Asset.

响应

HTTP 200

Successful response.

application/json

名称类型说明
asset_idstringGenerated asset identifier: 32 lowercase hexadecimal characters, preserved across overwrites.
public_idstringDelivery identifier unique within this library, used in asset URLs.
display_namestringHuman-readable asset name, independent of its delivery identifier.
asset_folderstringOrganizational folder path; the empty string denotes the root folder.
resource_typestringStored media category: image for images, video for video or audio, and raw for other files. Upload also accepts auto for detection.
typestringPublic asset delivery mode; upload is the only supported value.
formatstringDetected file format used as the delivery URL extension.
versionnumberMonotonically increasing asset version used in delivery URLs; based on upload time in Unix seconds and advanced on overwrite.
version_idstringIdentifier for this asset version, regenerated on overwrite.
bytesnumberSize of the original source content, in bytes.
etagstringMD5 digest of the source bytes, as 32 lowercase hexadecimal characters.
widthnumberSource image or video width in pixels, when known.
heightnumberSource image or video height in pixels, when known.
durationnumberSource audio or video duration in seconds, when known.
pagesnumber
is_audiobooleanTrue for audio-only media, which uses resource_type video.
original_filenamestringOriginal or overridden source filename with its final extension removed.
tagsarray<string>Labels attached to the asset.
contextobjectCustom string metadata; omitted when empty or excluded by the search projection.
context.customobjectCaller-supplied metadata entries with string values.
created_atstringTime this asset identity was created, in UTC.
urlstringURL for retrieving this version of the asset’s original content.
secure_urlstringHTTPS delivery URL for this asset version; equal to url.
placeholderbooleanFalse because this response represents stored source content.
existingboolean
processingobjectProgress of understanding and embedding tasks for the asset.
processing.statestring
processing.kindsobjectProcessing states by kind. tagging is present when auto_tagging was requested and follows visual understanding.
processing.updated_atstringTime the processing state was last updated, in UTC.
library_idstringIdentifier of the library containing this asset.
sha256stringSHA-256 digest of the source bytes, as 64 lowercase hexadecimal characters.
statusstringResource status; active identifies an asset that has not been deleted.
semanticstringSearch-vector status: pending awaits vector generation or reprocessing; ready has searchable vectors; unavailable indicates disabled, unsupported or failed embedding. Existing vectors may still serve searches while reprocessing is pending.
previewobjectGenerated video previews, present once preview generation succeeds.
preview.poster_urlstringDelivery URL of the video’s first-frame poster.
preview.storyboardobjectPreview sprite sheet with tile dimensions and sample spacing.
curl -X PATCH "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/assets/85b7ef616a8b4719a41777a036ebc1d2" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"display_name":"walk-lib-r1-MDP-1791733789929-plain"}'

HTTP 200

{
  "asset_id": "85b7ef616a8b4719a41777a036ebc1d2",
  "public_id": "walk-lib-r1-MDP-1791733789929-plain",
  "display_name": "walk-lib-r1-MDP-1791733789929-plain",
  "asset_folder": "",
  "resource_type": "image",
  "type": "upload",
  "format": "png",
  "version": 1791733810,
  "version_id": "fdf3c8cd40c2424d86e8397425a69857",
  "bytes": 70,
  "etag": "b357a19c87624c7c4d131aeeb4ae677f",
  "width": 1,
  "height": 1,
  "original_filename": "file",
  "tags": [
    "docs"
  ],
  "created_at": "2026-10-11T15:50:10.842Z",
  "url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733810/walk-lib-r1-MDP-1791733789929-plain.png",
  "secure_url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733810/walk-lib-r1-MDP-1791733789929-plain.png",
  "placeholder": false,
  "library_id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "sha256": "497790947d4666760ce38f3c00e852c71fdb66cae849bae8e9ede352719e1581",
  "status": "active",
  "processing": {
    "state": "processing",
    "kinds": {
      "embedding": "pending",
      "visual": "running"
    },
    "updated_at": "2026-10-11T15:50:17.571Z"
  },
  "semantic": "pending"
}

删除素材

DELETE /media/v1/libraries/{library_id}/assets/{asset_id}

参数位置类型说明
library_idpathstring库 ID
asset_idpathstring素材 ID

返回: Deleted.

响应

HTTP 200

Successful response.

application/json

名称类型说明
deletedbooleanTrue once this asset has been removed from the library.
curl -X DELETE "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/assets/e5f3de0d8609482d8b351894b133c8cb" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

HTTP 200

{
  "deleted": true
}

重新处理素材

POST /media/v1/libraries/{library_id}/assets/{asset_id}/reprocess

参数位置类型说明
library_idpathstring库 ID
asset_idpathstring素材 ID

请求体

字段类型必填说明
kindsProcessingKind[]否要强制重跑的处理种类;省略时只重试失败项

返回: Asset.

kinds 可选 visual、frames、transcript、embedding。不带 kinds 时,只重跑当前素材版本的失败任务。显式传 kinds 时,所选的 ready、failed、unsupported 任务会重置为 pending 并强制重跑;pending 或 running 任务原样跳过,重复请求不会重复入队。

kinds 必须适用于素材类型:图片为 visual、embedding;音频为 transcript、embedding;视频为 frames、visual、transcript、embedding;raw 没有可重跑的种类。全部不适用时返回 400 INVALID_PARAMS,消息列出该素材可用的 kinds;部分适用时只处理适用的种类,其余忽略(返回的 Asset 没有字段说明被忽略的种类,请以 processing.kinds 为准)。

重跑 visual、frames 或 transcript 时,旧结果立即标记为 superseded,同时将 embedding 与素材的 semantic 置为 pending。旧向量继续服务语义检索,直到新的向量写入后才被替换,因此重新处理期间素材不会从检索结果中消失;期间命中片段可能显示素材名称而非旧描述。默认读取只返回当前结果;使用 include_superseded=true 可查看历史。请求立即返回更新后的 Asset,处理异步完成。

curl -X POST "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/assets/${ASSET_ID}/reprocess" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{}'

响应

HTTP 200

Successful response.

application/json

名称类型说明
asset_idstringGenerated asset identifier: 32 lowercase hexadecimal characters, preserved across overwrites.
public_idstringDelivery identifier unique within this library, used in asset URLs.
display_namestringHuman-readable asset name, independent of its delivery identifier.
asset_folderstringOrganizational folder path; the empty string denotes the root folder.
resource_typestringStored media category: image for images, video for video or audio, and raw for other files. Upload also accepts auto for detection.
typestringPublic asset delivery mode; upload is the only supported value.
formatstringDetected file format used as the delivery URL extension.
versionnumberMonotonically increasing asset version used in delivery URLs; based on upload time in Unix seconds and advanced on overwrite.
version_idstringIdentifier for this asset version, regenerated on overwrite.
bytesnumberSize of the original source content, in bytes.
etagstringMD5 digest of the source bytes, as 32 lowercase hexadecimal characters.
widthnumberSource image or video width in pixels, when known.
heightnumberSource image or video height in pixels, when known.
durationnumberSource audio or video duration in seconds, when known.
pagesnumber
is_audiobooleanTrue for audio-only media, which uses resource_type video.
original_filenamestringOriginal or overridden source filename with its final extension removed.
tagsarray<string>Labels attached to the asset.
contextobjectCustom string metadata; omitted when empty or excluded by the search projection.
context.customobjectCaller-supplied metadata entries with string values.
created_atstringTime this asset identity was created, in UTC.
urlstringURL for retrieving this version of the asset’s original content.
secure_urlstringHTTPS delivery URL for this asset version; equal to url.
placeholderbooleanFalse because this response represents stored source content.
existingboolean
processingobjectProgress of understanding and embedding tasks for the asset.
processing.statestring
processing.kindsobjectProcessing states by kind. tagging is present when auto_tagging was requested and follows visual understanding.
processing.updated_atstringTime the processing state was last updated, in UTC.
library_idstringIdentifier of the library containing this asset.
sha256stringSHA-256 digest of the source bytes, as 64 lowercase hexadecimal characters.
statusstringResource status; active identifies an asset that has not been deleted.
semanticstringSearch-vector status: pending awaits vector generation or reprocessing; ready has searchable vectors; unavailable indicates disabled, unsupported or failed embedding. Existing vectors may still serve searches while reprocessing is pending.
previewobjectGenerated video previews, present once preview generation succeeds.
preview.poster_urlstringDelivery URL of the video’s first-frame poster.
preview.storyboardobjectPreview sprite sheet with tile dimensions and sample spacing.

AssetPage

字段类型必填说明
dataAsset[]是本页结果
next_cursorstring / null是下一页游标;没有时为 null 或省略

CloudinaryResource

字段类型必填说明
asset_idAssetId是素材 ID
public_idstring是交付地址中的素材名称,可带路径
display_namestring是显示名称
asset_folderstring是组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根
resource_typeResourceType是image、video(含音频)或 raw;auto 只用于上传,列表传 auto 或其他值返回 400
typeDeliveryType是资源或事件类型
formatstring是文件格式
versionnumber是交付版本号
version_idstring是版本标识
bytesnumber是文件字节数
etagstring是文件校验标识
widthnumber否宽度像素
heightnumber否高度像素
durationnumber否时长秒数
pagesnumber否文档页数
is_audioboolean否是否为音频
original_filenamestring否原文件名称
tagsstring[]是素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换
contextobject否自定义文字键值;PATCH 整体替换,传 {} 清空
created_atIsoTimestamp是创建时间
urlstring是原文件地址
secure_urlstring是HTTPS 交付地址
placeholderfalse是固定为 false
existingboolean否未覆盖时是否返回已有素材
processingProcessing否整体与各项理解状态

Asset

字段类型必填说明
asset_idAssetId是素材 ID
public_idstring是交付地址中的素材名称,可带路径
display_namestring是显示名称
asset_folderstring是组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根
resource_typeResourceType是image、video(含音频)或 raw;auto 只用于上传,列表传 auto 或其他值返回 400
typeDeliveryType是资源或事件类型
formatstring是文件格式
versionnumber是交付版本号
version_idstring是版本标识
bytesnumber是文件字节数
etagstring是文件校验标识
widthnumber否宽度像素
heightnumber否高度像素
durationnumber否时长秒数
pagesnumber否文档页数
is_audioboolean否是否为音频
original_filenamestring否原文件名称
tagsstring[]是素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换
contextobject否自定义文字键值;PATCH 整体替换,传 {} 清空
created_atIsoTimestamp是创建时间
urlstring是原文件地址
secure_urlstring是HTTPS 交付地址
placeholderfalse是固定为 false
existingboolean否未覆盖时是否返回已有素材
processingProcessing是整体与各项理解状态
library_idLibraryId是库 ID
sha256string是内容校验摘要
status"active"是资源状态
semantic"pending" / "ready" / "unavailable"是ready 时可语义检索
previewobject否预览海报和故事板

Deleted

字段类型必填说明
deletedtrue是删除结果

Processing

字段类型必填说明
stateProcessingState是整体处理状态
kindsobject是各项处理状态
updated_atIsoTimestamp是更新时间

Storyboard

字段类型必填说明
urlstring是原文件地址
tilesnumber是故事板画面数
interval_msnumber是画面间隔毫秒数
tile_widthnumber是单个画面宽度
tile_heightnumber是单个画面高度

理解结果

重新理解已有素材

kinds 可选 visual、frames、transcript、embedding。不带 kinds 时,只重跑当前素材版本的失败任务。显式传 kinds 时,所选的 ready、failed、unsupported 任务会重置为 pending 并强制重跑;pending 或 running 任务原样跳过,重复请求不会重复入队。

kinds 必须适用于素材类型:图片为 visual、embedding;音频为 transcript、embedding;视频为 frames、visual、transcript、embedding;raw 没有可重跑的种类。全部不适用时返回 400 INVALID_PARAMS,消息列出该素材可用的 kinds;部分适用时只处理适用的种类,其余忽略(返回的 Asset 没有字段说明被忽略的种类,请以 processing.kinds 为准)。

重跑 visual、frames 或 transcript 时,旧结果立即标记为 superseded,同时将 embedding 与素材的 semantic 置为 pending。旧向量继续服务语义检索,直到新的向量写入后才被替换,因此重新处理期间素材不会从检索结果中消失;期间命中片段可能显示素材名称而非旧描述。默认读取只返回当前结果;使用 include_superseded=true 可查看历史。请求立即返回更新后的 Asset,处理异步完成。

转写幻听过滤

转写片段先做全角转半角、转小写并去除首尾空白和标点。规范化后为空,或整段命中常见幻听短语表时,丢弃该片段。仅完整匹配,不做子串匹配,例如 “thank you for the report” 会保留。

短语表包括:thank you、thanks for watching、thank you for watching、please subscribe、subscribe、you、bye、字幕由amara.org社区提供、请不吝点赞 订阅 转发 打赏支持明镜与点点栏目、谢谢观看、优优独播剧场——yoyo television series exclusive。

被过滤的片段不进入转写文字、关键词索引或转写向量。全部被过滤时,transcript 理解仍为 ready,content 为空字符串,data 为 { "filtered_segments": n },n 是被过滤的片段数;该素材不会生成转写向量。

指南 →

基础地址与鉴权

读取理解

GET /media/v1/libraries/{library_id}/assets/{asset_id}/understandings

参数位置类型说明
library_idpathstring库 ID
asset_idpathstring素材 ID
include_supersededqueryboolean包含已被新版本替代的结果;只接受 true 或 false
kindquerycaption / tags / ocr / transcript / frame理解或处理种类;列出理解结果时按此筛选
cursorquerystring上一页的 next_cursor
limitqueryinteger每页 1–200 条,默认 200

返回: UnderstandingPage.

响应

HTTP 200

Successful response.

application/json

名称类型说明
dataarray<object>Understanding results in this page, ordered by creation time ascending.
data[].idstringGenerated identifier of this understanding result.
data[].asset_idstringIdentifier of the asset from which this result was produced.
data[].asset_versionnumberAsset version processed to produce this result; compare with the asset’s current version.
data[].kindstringResult kind: caption is a visual description, tags are recognized labels, ocr is text recognized in the image, transcript is speech text, and frame is a description of a video segment.
data[].producerstringProducer model identifier; a failure may use the configured model when no model response is available.
data[].producer_versionstring
data[].segmentobject | nullSource-media time range for a frame or transcript segment; null for results without a segment.
data[].statusstringResult status: ready contains completed output; failed records an error.
data[].contentstring | nullText output, such as a caption, recognized text or transcript; null for structured-only or failed results.
data[].dataany | nullStructured producer output, such as recognized labels or frame details; null when absent.
data[].confidencenumber | null
data[].errorobject | nullFailure code and message, or null for a successful result.
data[].supersededbooleanWhether a newer result or asset version has replaced this result. Excluded from listing unless include_superseded is true.
data[].created_atstringTime this immutable result was recorded, in UTC.
next_cursorstring | nullOpaque token to pass as cursor to listUnderstandings; null means no further page.
curl -X GET "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/assets/9339cdae93804c0c8c65d5189ef1f646/understandings" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

HTTP 200

{
  "data": [],
  "next_cursor": null
}

UnderstandingPage

字段类型必填说明
dataUnderstanding[]是本页结果
next_cursorstring / null是下一页游标;没有时为 null 或省略

Understanding

字段类型必填说明
idUnderstandingId是资源 ID
asset_idAssetId是素材 ID
asset_versionnumber是理解对应的素材版本
kindUnderstandingKind是理解或处理种类;列出理解结果时按此筛选
producerstring是理解生成者
producer_versionstring是生成者版本
segmentSegment / null是起止毫秒;整份素材为 null
status"ready" / "failed"是资源状态
contentstring / null是理解的文字内容
dataJSON / null是本页结果
confidencenumber / null是置信度;可能为空
errorobject / null是错误码与消息;成功时为空
supersededboolean是是否被新版本替代
created_atIsoTimestamp是创建时间

Segment

字段类型必填说明
start_msnumber是片段开始毫秒
end_msnumber是片段结束毫秒

检索

expression 接受表达式;semantic 与 search 接受自然语言。语义检索只返回就绪素材。

表达式语法

指南 →

基础地址与鉴权

表达式检索

POST /media/v1/libraries/{library_id}/search/expression

参数位置类型说明
library_idpathstring库 ID

请求体

字段类型必填说明
expressionstring否结构化查询表达式;空表达式返回全部素材
sort_byobject[]否排序字段与方向
max_resultsinteger否最多 500;检索默认 100,Admin 默认 10
next_cursorstring否下一页游标;没有时为 null 或省略
with_fieldtags / context[]否额外返回 tags 或 context
aggregateAggregateField[]否统计字段

返回: ExpressionSearchResult.

响应

HTTP 200

Successful response.

application/json

名称类型说明
total_countnumberNumber of matching assets across pages; a lower bound when total_count_exact is false.
timenumberElapsed search time in whole milliseconds.
next_cursorstringContinuation token for the next page; omitted when no further page is available.
resourcesarray<object>Assets in this page, ordered by sort_by; tags and context follow with_field.
resources[].asset_idstringGenerated asset identifier: 32 lowercase hexadecimal characters, preserved across overwrites.
resources[].public_idstringDelivery identifier unique within this library, used in asset URLs.
resources[].display_namestringHuman-readable asset name, independent of its delivery identifier.
resources[].asset_folderstringOrganizational folder path; the empty string denotes the root folder.
resources[].resource_typestringStored media category: image for images, video for video or audio, and raw for other files. Upload also accepts auto for detection.
resources[].typestringPublic asset delivery mode; upload is the only supported value.
resources[].formatstringDetected file format used as the delivery URL extension.
resources[].versionnumberMonotonically increasing asset version used in delivery URLs; based on upload time in Unix seconds and advanced on overwrite.
resources[].version_idstringIdentifier for this asset version, regenerated on overwrite.
resources[].bytesnumberSize of the original source content, in bytes.
resources[].etagstringMD5 digest of the source bytes, as 32 lowercase hexadecimal characters.
resources[].widthnumberSource image or video width in pixels, when known.
resources[].heightnumberSource image or video height in pixels, when known.
resources[].durationnumberSource audio or video duration in seconds, when known.
resources[].pagesnumber
resources[].is_audiobooleanTrue for audio-only media, which uses resource_type video.
resources[].original_filenamestringOriginal or overridden source filename with its final extension removed.
resources[].tagsarray<string>Labels attached to the asset.
resources[].contextobjectCustom string metadata; omitted when empty or excluded by the search projection.
resources[].created_atstringTime this asset identity was created, in UTC.
resources[].urlstringURL for retrieving this version of the asset’s original content.
resources[].secure_urlstringHTTPS delivery URL for this asset version; equal to url.
resources[].placeholderbooleanFalse because this response represents stored source content.
resources[].existingboolean
resources[].processingobjectProgress of understanding and embedding tasks for the asset.
resources[].library_idstringIdentifier of the library containing this asset.
resources[].sha256stringSHA-256 digest of the source bytes, as 64 lowercase hexadecimal characters.
resources[].statusstringResource status; active identifies an asset that has not been deleted.
resources[].semanticstringSearch-vector status: pending awaits vector generation or reprocessing; ready has searchable vectors; unavailable indicates disabled, unsupported or failed embedding. Existing vectors may still serve searches while reprocessing is pending.
resources[].previewobjectGenerated video previews, present once preview generation succeeds.
aggregationsobjectRequested facet counts, keyed by facet name and then by field value.
total_count_exactbooleanWhether total_count covers all matches; false indicates a bounded partial count.
aggregations_exactbooleanWhether the returned facet counts cover all matching assets.
curl -X POST "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/search/expression" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"expression":"tags:docs"}'

HTTP 200

{
  "total_count": 2,
  "total_count_exact": true,
  "time": 0,
  "resources": [
    {
      "asset_id": "9dfa312ef9bc4b00816339b598b1152c",
      "public_id": "walk-lib-r1-MDP-1791733789929-tagged",
      "display_name": "walk-lib-r1-MDP-1791733789929-tagged",
      "asset_folder": "",
      "resource_type": "image",
      "type": "upload",
      "format": "png",
      "version": 1791733815,
      "version_id": "26cb8171caa5431b8373ad417fd71e32",
      "bytes": 70,
      "etag": "b357a19c87624c7c4d131aeeb4ae677f",
      "width": 1,
      "height": 1,
      "original_filename": "file",
      "processing": {
        "state": "processing",
        "kinds": {
          "embedding": "pending",
          "visual": "running",
          "tagging": "running"
        },
        "updated_at": "2026-10-11T15:50:17.571Z"
      },
      "created_at": "2026-10-11T15:50:15.996Z",
      "url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733815/walk-lib-r1-MDP-1791733789929-tagged.png",
      "secure_url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733815/walk-lib-r1-MDP-1791733789929-tagged.png",
      "placeholder": false,
      "library_id": "lib_d3881a2f54a34cd79121b9d659e8378c",
      "sha256": "497790947d4666760ce38f3c00e852c71fdb66cae849bae8e9ede352719e1581",
      "status": "active",
      "semantic": "pending"
    },
    {
      "asset_id": "85b7ef616a8b4719a41777a036ebc1d2",
      "public_id": "walk-lib-r1-MDP-1791733789929-plain",
      "display_name": "walk-lib-r1-MDP-1791733789929-plain",
      "asset_folder": "",
      "resource_type": "image",
      "type": "upload",
      "format": "png",
      "version": 1791733810,
      "version_id": "fdf3c8cd40c2424d86e8397425a69857",
      "bytes": 70,
      "etag": "b357a19c87624c7c4d131aeeb4ae677f",
      "width": 1,
      "height": 1,
      "original_filename": "file",
      "created_at": "2026-10-11T15:50:10.842Z",
      "url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733810/walk-lib-r1-MDP-1791733789929-plain.png",
      "secure_url": "https://media-develop.praxisusercontent.com/lib_d3881a2f54a34cd79121b9d659e8378c/image/upload/v1791733810/walk-lib-r1-MDP-1791733789929-plain.png",
      "placeholder": false,
      "library_id": "lib_d3881a2f54a34cd79121b9d659e8378c",
      "sha256": "497790947d4666760ce38f3c00e852c71fdb66cae849bae8e9ede352719e1581",
      "status": "active",
      "processing": {
        "state": "processing",
        "kinds": {
          "embedding": "pending",
          "visual": "running"
        },
        "updated_at": "2026-10-11T15:50:17.571Z"
      },
      "semantic": "pending"
    }
  ]
}

以图搜图

POST /media/v1/libraries/{library_id}/search/visual

参数位置类型说明
library_idpathstring库 ID

请求体

字段类型必填说明
asset_idAssetId否素材 ID
imageobject否查询图片对象,data 为 base64,mime 为图片类型
top_kinteger否命中数,1–50
filterstring否表达式筛选条件

返回: SemanticSearchResult.

库的 search.image 为 true 时可用;不支持的库返回 LIBRARY_INVALID_STATE。图片仅接受 JPEG、PNG、WebP、GIF,解码后最大 10 MiB。每个素材返回最高分命中,视频定位到最佳帧。qwen3-vl-embedding 的图片相似度门槛为 0.35。标定来自 2026-10-10 的测试:同图变体 0.82–0.96,同类场景 0.38–0.66,无关图片最高 0.34。

asset_id 与 image: { data, mime } 必须且只能给一个。asset_id 复用已有图片理解并排除素材自身;视频使用第一帧,未完成理解返回 LIBRARY_INVALID_STATE。上传图片的 data 为 base64。top_k 默认 20,范围 1–50;filter 使用与 semantic 相同的表达式。仅检索图片相似内容,返回与 semantic 相同的 hits、embedding_producer、not_ready_excluded;matches.kind 为 image,snippet 为最新描述或素材名称。删除、旧版本及已替换的理解不会出现在结果中。

响应

HTTP 200

Successful response.

application/json

名称类型说明
hitsarray<object>Ranked assets up to top_k; an empty array means no eligible matches were found.
hits[].assetobjectAsset matched by the query.
hits[].scorenumberRanking score: cosine similarity for semantic or visual search; normalized rank-fusion score for hybrid search. Higher values rank first.
hits[].semantic_scorenumber | nullCosine similarity for hybrid hits with a semantic match; null for keyword-only hybrid hits. Omitted outside hybrid mode.
hits[].matchesarray<object>Supporting content or metadata matches contributing to this asset’s hit.
embedding_producerstringEmbedding model identifier used for the query, or for the source asset embedding in an asset-based visual query.
not_ready_excludednumberNumber of distinct candidate asset identifiers, or unresolved vector identifiers, excluded because their vectors or assets were missing, deleted or stale; not a count of all pending assets in the library.

语义检索

POST /media/v1/libraries/{library_id}/search/semantic

参数位置类型说明
library_idpathstring库 ID

请求体

字段类型必填说明
querystring是用自然语言描述要找的内容
filterstring否表达式筛选条件
top_kinteger否命中数,1–50
modehybrid / semantic否hybrid 结合关键词与语义;semantic 仅语义

返回: SemanticSearchResult.

使用 bge-m3 时,向量候选在与关键词结果融合前按余弦相似度 ≥ 0.55 筛选,新完成的内容也使用相同门槛。门槛依据 2026-10-09 的 7 个演示素材标定:相关结果最低约 0.58(0.581–0.729),不相关结果最高 0.523;完全无关的查询最高 0.478。qwen3-vl-embedding 的文字查询对文字内容(描述、转写)门槛为 0.40,对图片内容门槛为 0.25;其他模型尚未标定,暂不过滤。关键词命中不受此门槛影响。查询与库内容都不相关时返回空列表;mode=semantic 只返回达到向量门槛的结果。

响应

HTTP 200

Successful response.

application/json

名称类型说明
hitsarray<object>Ranked assets up to top_k; an empty array means no eligible matches were found.
hits[].assetobjectAsset matched by the query.
hits[].scorenumberRanking score: cosine similarity for semantic or visual search; normalized rank-fusion score for hybrid search. Higher values rank first.
hits[].semantic_scorenumber | nullCosine similarity for hybrid hits with a semantic match; null for keyword-only hybrid hits. Omitted outside hybrid mode.
hits[].matchesarray<object>Supporting content or metadata matches contributing to this asset’s hit.
embedding_producerstringEmbedding model identifier used for the query, or for the source asset embedding in an asset-based visual query.
not_ready_excludednumberNumber of distinct candidate asset identifiers, or unresolved vector identifiers, excluded because their vectors or assets were missing, deleted or stale; not a count of all pending assets in the library.

语义检索别名

POST /media/v1/libraries/{library_id}/search

参数位置类型说明
library_idpathstring库 ID

请求体

字段类型必填说明
querystring是用自然语言描述要找的内容
filterstring否表达式筛选条件
top_kinteger否命中数,1–50
modehybrid / semantic否hybrid 结合关键词与语义;semantic 仅语义

返回: SemanticSearchResult.

响应

HTTP 200

Successful response.

application/json

名称类型说明
hitsarray<object>Ranked assets up to top_k; an empty array means no eligible matches were found.
hits[].assetobjectAsset matched by the query.
hits[].scorenumberRanking score: cosine similarity for semantic or visual search; normalized rank-fusion score for hybrid search. Higher values rank first.
hits[].semantic_scorenumber | nullCosine similarity for hybrid hits with a semantic match; null for keyword-only hybrid hits. Omitted outside hybrid mode.
hits[].matchesarray<object>Supporting content or metadata matches contributing to this asset’s hit.
embedding_producerstringEmbedding model identifier used for the query, or for the source asset embedding in an asset-based visual query.
not_ready_excludednumberNumber of distinct candidate asset identifiers, or unresolved vector identifiers, excluded because their vectors or assets were missing, deleted or stale; not a count of all pending assets in the library.

ExpressionSearchResult

字段类型必填说明
total_countnumber是匹配总数
timenumber是检索耗时,整数毫秒,由服务端测得
next_cursorstring否下一页游标;没有时为 null 或省略
resourcesSearchAsset[]是本页素材
aggregationsobject否按请求字段统计
total_count_exactboolean否计数是否精确
aggregations_exactboolean否统计是否精确

SemanticSearchResult

字段类型必填说明
hitsSemanticHit[]是检索命中
embedding_producerstring是语义理解生成者
not_ready_excludednumber是因未就绪而排除的素材数

SearchAsset

字段类型必填说明
asset_idAssetId是素材 ID
public_idstring是交付地址中的素材名称,可带路径
display_namestring是显示名称
asset_folderstring是组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根
resource_typeResourceType是image、video(含音频)或 raw;auto 只用于上传,列表传 auto 或其他值返回 400
typeDeliveryType是资源或事件类型
formatstring是文件格式
versionnumber是交付版本号
version_idstring是版本标识
bytesnumber是文件字节数
etagstring是文件校验标识
widthnumber否宽度像素
heightnumber否高度像素
durationnumber否时长秒数
pagesnumber否文档页数
is_audioboolean否是否为音频
original_filenamestring否原文件名称
tagsstring[]否素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换
contextobject否自定义文字键值;PATCH 整体替换,传 {} 清空
created_atIsoTimestamp是创建时间
urlstring是原文件地址
secure_urlstring是HTTPS 交付地址
placeholderfalse是固定为 false
existingboolean否未覆盖时是否返回已有素材
processingProcessing是整体与各项理解状态
library_idLibraryId是库 ID
sha256string是内容校验摘要
status"active"是资源状态
semantic"pending" / "ready" / "unavailable"是ready 时可语义检索
previewobject否预览海报和故事板

SemanticHit

字段类型必填说明
assetAsset是命中的素材
scorenumber是相关度分数
semantic_scorenumber / null否—
matchesSemanticMatch[]是匹配内容与片段时间

SemanticMatch

字段类型必填说明
kindUnderstandingKind / "metadata" / "image"是理解或处理种类;列出理解结果时按此筛选
understanding_idUnderstandingId / null是对应的理解记录;元数据命中为空
segmentSegment / null是起止毫秒;整份素材为 null
snippetstring是命中文字片段

文件夹

指南 →

基础地址与鉴权

列出文件夹

GET /media/v1/libraries/{library_id}/folders

参数位置类型说明
library_idpathstring库 ID
parentquerystring父文件夹路径;省略或空字符串为根。一次返回这一层的全部子文件夹,不分页;传 limit 或 cursor 返回 400

返回: Folders.

响应

HTTP 200

Successful response.

application/json

名称类型说明
foldersarray<object>All immediate child folders of parent, sorted by path.
folders[].namestringFinal path segment naming the child folder.
folders[].pathstringFull folder path relative to the library root.
folders[].asset_countnumberNumber of assets in this folder and all descendant folders.
curl -X GET "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/folders" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

HTTP 200

{
  "folders": [
    {
      "name": "examples",
      "path": "examples",
      "asset_count": 1
    }
  ]
}

Folders

字段类型必填说明
foldersobject[]是文件夹列表

批量操作

指南 →

基础地址与鉴权

批量操作

POST /media/v1/libraries/{library_id}/batches

参数位置类型说明
library_idpathstring库 ID

请求体

字段类型必填说明
action"tag" / "untag"是批量操作
tagsstring[]是素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换
字段类型必填说明
action"set_context"是批量操作
contextobject是自定义文字键值;PATCH 整体替换,传 {} 清空
字段类型必填说明
action"move"是批量操作
asset_folderstring是组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根
字段类型必填说明
action"delete"是批量操作
字段类型必填说明
selectorBatchSelector是按 ID 或表达式选择

返回: Job.

响应

HTTP 200

Successful response.

application/json

名称类型说明
idstringGenerated batch identifier: job_ followed by 32 lowercase hexadecimal characters.
library_idstringIdentifier of the library in which the batch operates.
actionstringBatch operation: tag adds labels, untag removes labels, set_context replaces custom metadata, move changes asset_folder, and delete removes selected assets.
statusstringJob status: queued awaits execution; running is processing items; completed means all items succeeded; completed_with_errors means some succeeded and some failed; failed means all selected items failed. An empty job completes successfully.
totalnumberNumber of distinct assets selected when the job was created.
donenumberNumber of items successfully processed; failed items are counted separately.
failednumberNumber of items that could not be processed successfully.
failuresarray<object>Always present, including an empty array before any item failure or when all items succeed. At most 20 item failures are returned.
failures[].asset_idstringIdentifier supplied for the failed item; it may identify a missing asset.
failures[].codestringDomain error code explaining the individual item failure.
created_atstringTime the batch job was created, in UTC.
finished_atstring | nullTime the job reached a terminal status, or null while queued or running.
curl -X POST "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/batches" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"action":"tag","tags":["sample"],"selector":{"ids":["85b7ef616a8b4719a41777a036ebc1d2","00000000000000000000000000000000"]}}'

HTTP 200

{
  "id": "job_b562f087623c4756b43813e3dce670ba",
  "library_id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "action": "tag",
  "status": "queued",
  "total": 2,
  "done": 0,
  "failed": 0,
  "created_at": "2026-10-11T15:50:24.942Z",
  "failures": [],
  "finished_at": null
}

读取任务

GET /media/v1/libraries/{library_id}/batches/{job_id}

参数位置类型说明
library_idpathstring库 ID
job_idpathstring任务 ID

返回: Job.

响应

HTTP 200

Successful response.

application/json

名称类型说明
idstringGenerated batch identifier: job_ followed by 32 lowercase hexadecimal characters.
library_idstringIdentifier of the library in which the batch operates.
actionstringBatch operation: tag adds labels, untag removes labels, set_context replaces custom metadata, move changes asset_folder, and delete removes selected assets.
statusstringJob status: queued awaits execution; running is processing items; completed means all items succeeded; completed_with_errors means some succeeded and some failed; failed means all selected items failed. An empty job completes successfully.
totalnumberNumber of distinct assets selected when the job was created.
donenumberNumber of items successfully processed; failed items are counted separately.
failednumberNumber of items that could not be processed successfully.
failuresarray<object>Always present, including an empty array before any item failure or when all items succeed. At most 20 item failures are returned.
failures[].asset_idstringIdentifier supplied for the failed item; it may identify a missing asset.
failures[].codestringDomain error code explaining the individual item failure.
created_atstringTime the batch job was created, in UTC.
finished_atstring | nullTime the job reached a terminal status, or null while queued or running.
curl -X GET "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/batches/job_b562f087623c4756b43813e3dce670ba" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

HTTP 200

{
  "id": "job_b562f087623c4756b43813e3dce670ba",
  "library_id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "action": "tag",
  "status": "completed_with_errors",
  "total": 2,
  "done": 1,
  "failed": 1,
  "created_at": "2026-10-11T15:50:24.942Z",
  "failures": [
    {
      "asset_id": "00000000000000000000000000000000",
      "code": "ASSET_NOT_FOUND"
    }
  ],
  "finished_at": "2026-10-11T15:50:27.555Z"
}

批量操作别名

POST /media/v1/libraries/{library_id}/assets:batch

参数位置类型说明
library_idpathstring库 ID

请求体

字段类型必填说明
action"tag" / "untag"是批量操作
tagsstring[]是素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换
字段类型必填说明
action"set_context"是批量操作
contextobject是自定义文字键值;PATCH 整体替换,传 {} 清空
字段类型必填说明
action"move"是批量操作
asset_folderstring是组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根
字段类型必填说明
action"delete"是批量操作
字段类型必填说明
selectorBatchSelector是按 ID 或表达式选择

返回: Job.

响应

HTTP 200

Successful response.

application/json

名称类型说明
idstringGenerated batch identifier: job_ followed by 32 lowercase hexadecimal characters.
library_idstringIdentifier of the library in which the batch operates.
actionstringBatch operation: tag adds labels, untag removes labels, set_context replaces custom metadata, move changes asset_folder, and delete removes selected assets.
statusstringJob status: queued awaits execution; running is processing items; completed means all items succeeded; completed_with_errors means some succeeded and some failed; failed means all selected items failed. An empty job completes successfully.
totalnumberNumber of distinct assets selected when the job was created.
donenumberNumber of items successfully processed; failed items are counted separately.
failednumberNumber of items that could not be processed successfully.
failuresarray<object>Always present, including an empty array before any item failure or when all items succeed. At most 20 item failures are returned.
failures[].asset_idstringIdentifier supplied for the failed item; it may identify a missing asset.
failures[].codestringDomain error code explaining the individual item failure.
created_atstringTime the batch job was created, in UTC.
finished_atstring | nullTime the job reached a terminal status, or null while queued or running.
curl -X POST "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/assets:batch" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"action":"tag","tags":["sample"],"selector":{"ids":["85b7ef616a8b4719a41777a036ebc1d2"]}}'

HTTP 200

{
  "id": "job_3c2fe728de054c7396058c7438b289d2",
  "library_id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "action": "tag",
  "status": "queued",
  "total": 1,
  "done": 0,
  "failed": 0,
  "created_at": "2026-10-11T15:50:29.266Z",
  "failures": [],
  "finished_at": null
}

读取任务别名

GET /media/v1/libraries/{library_id}/jobs/{job_id}

参数位置类型说明
library_idpathstring库 ID
job_idpathstring任务 ID

返回: Job.

响应

HTTP 200

Successful response.

application/json

名称类型说明
idstringGenerated batch identifier: job_ followed by 32 lowercase hexadecimal characters.
library_idstringIdentifier of the library in which the batch operates.
actionstringBatch operation: tag adds labels, untag removes labels, set_context replaces custom metadata, move changes asset_folder, and delete removes selected assets.
statusstringJob status: queued awaits execution; running is processing items; completed means all items succeeded; completed_with_errors means some succeeded and some failed; failed means all selected items failed. An empty job completes successfully.
totalnumberNumber of distinct assets selected when the job was created.
donenumberNumber of items successfully processed; failed items are counted separately.
failednumberNumber of items that could not be processed successfully.
failuresarray<object>Always present, including an empty array before any item failure or when all items succeed. At most 20 item failures are returned.
failures[].asset_idstringIdentifier supplied for the failed item; it may identify a missing asset.
failures[].codestringDomain error code explaining the individual item failure.
created_atstringTime the batch job was created, in UTC.
finished_atstring | nullTime the job reached a terminal status, or null while queued or running.
curl -X GET "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/jobs/job_3c2fe728de054c7396058c7438b289d2" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

HTTP 200

{
  "id": "job_3c2fe728de054c7396058c7438b289d2",
  "library_id": "lib_d3881a2f54a34cd79121b9d659e8378c",
  "action": "tag",
  "status": "completed",
  "total": 1,
  "done": 1,
  "failed": 0,
  "created_at": "2026-10-11T15:50:29.266Z",
  "failures": [],
  "finished_at": "2026-10-11T15:50:29.494Z"
}

Job

字段类型必填说明
idJobId是资源 ID
library_idLibraryId是库 ID
actiontag / untag / set_context / move / delete是批量操作
status"queued" / "running" / "completed" / "completed_with_errors" / "failed"是资源状态
totalnumber是任务素材总数
donenumber是已完成数量;分片响应中表示是否完成
failednumber是失败数量
failuresobject[]是—
created_atIsoTimestamp是创建时间
finished_atIsoTimestamp / null是结束时间;未结束为空

BatchSelector

字段类型必填说明
idsAssetId[]是素材 ID 列表
字段类型必填说明
expressionstring是结构化查询表达式;空表达式返回全部素材
exclusionsAssetId[]否从选择中排除的素材 ID

BatchAction

字段类型必填说明
action"tag" / "untag"是批量操作
tagsstring[]是素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换
字段类型必填说明
action"set_context"是批量操作
contextobject是自定义文字键值;PATCH 整体替换,传 {} 清空
字段类型必填说明
action"move"是批量操作
asset_folderstring是组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根
字段类型必填说明
action"delete"是批量操作

事件

按 seq 翻页:asc 配 after_seq,desc 配 before_seq;两个游标不可同用。

指南 →

基础地址与鉴权

读取事件

GET /media/v1/libraries/{library_id}/events

参数位置类型说明
library_idpathstring库 ID
after_seqqueryinteger升序游标;不可与 before_seq 同用
before_seqqueryinteger降序游标;不可与 after_seq 同用
orderqueryasc / descasc 默认升序或 desc 降序
limitqueryinteger每页 1–200 条,默认 50

返回: MediaEventPage.

响应

HTTP 200

Successful response.

application/json

名称类型说明
dataarray<object>Events in this page, ordered by sequence in the requested direction.
data[].seqnumberIncreasing sequence number within this library; use it with after_seq or before_seq to page through events.
data[].idstringUnique identifier of this recorded event.
data[].typestringType of lifecycle, asset, processing, search or batch change recorded.
data[].processed_atstringTime this event was recorded, in UTC.
data[].library_idstringIdentifier of the library whose event was recorded.
data[].asset_idstringRelated asset identifier, when the event concerns an asset.
data[].job_idstringRelated batch job identifier, when present.
data[].kindstringRelated processing task: visual, frames, transcript or embedding.
data[].detailobjectEvent-specific details, such as changed values, reprocessing kinds or failed-item counts.
next_cursorstring | nullLast returned sequence as a string when more events exist; convert to a number and pass as after_seq for asc or before_seq for desc. Null means no further page.
curl -X GET "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/events?limit=1" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"

HTTP 200

{
  "data": [
    {
      "seq": 1,
      "id": "2cd2cd71-1fc5-41fc-aeb0-29583af9b900",
      "type": "library.status_provisioning",
      "processed_at": "2026-10-09T09:34:09.858Z",
      "library_id": "lib_fff73e25733449b1bf6f880d91f5c045"
    }
  ],
  "next_cursor": "1"
}

MediaEventPage

字段类型必填说明
dataMediaEvent[]是本页结果
next_cursorstring / null是下一页游标;没有时为 null 或省略

MediaEvent

字段类型必填说明
seqnumber是库内递增的事件序号
idstring是资源 ID
typeMediaEventType是资源或事件类型
processed_atIsoTimestamp是事件时间
library_idLibraryId是库 ID
asset_idAssetId否素材 ID
job_idJobId否任务 ID
kindProcessingKind否理解或处理种类;列出理解结果时按此筛选
detailobject否事件详情

错误码

指南 →

自有 API 返回 error.code、error.message、error.details。兼容接口返回 error.message,并通过 X-Cld-Error 响应头重复消息;非 ASCII 消息在响应头中使用百分号编码。

领域码自有 HTTP兼容 HTTP可重试
LIBRARY_NOT_FOUND404404否
ASSET_NOT_FOUND404404否
JOB_NOT_FOUND404404否
UNDERSTANDING_NOT_FOUND404404否
LIBRARY_INVALID_STATE409400否
INVALID_PARAMS400400否
INVALID_EXPRESSION400400否
UNSUPPORTED400400否
NOT_IMPLEMENTED501400否
FILE_TOO_LARGE413400否
FILE_EMPTY400400否
UNSUPPORTED_MEDIA415400否
FETCH_FAILED400400否
LIMIT_EXCEEDED400400否
CHUNK_INVALID400400否
RATE_LIMITED429420是
CAPACITY503500是
UPSTREAM_FAILED502500是

可重试错误采用退避重试;其它错误先修正请求或资源状态。

模型配置错误

  • 400 INVALID_PARAMS:模型调用 ID 不存在(Model <id> is not available)、vision 模型不支持图片输入,或 models 含未知角色、空白 ID 或不合法的值。
  • 409 LIBRARY_INVALID_STATE:库中已有素材时更换 embedding,包括恢复默认值导致模型改变。消息为「库中已有素材时不能更换嵌入模型」。
  • 502 UPSTREAM_FAILED:写入模型配置时无法查询模型目录;可退避重试。