跳转到内容
EN

检索

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

表达式语法

指南 →

基础地址与鉴权

表达式检索

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

参数 位置 类型 说明
library_id path string 库 ID

请求体

字段 类型 必填 说明
expression string 否 结构化查询表达式;空表达式返回全部素材
sort_by object[] 否 排序字段与方向
max_results integer 否 最多 500;检索默认 100,Admin 默认 10
next_cursor string 否 下一页游标;没有时为 null 或省略
with_field tags / context[] 否 额外返回 tags 或 context
aggregate AggregateField[] 否 统计字段
stack boolean 否 —

返回: ExpressionSearchResult.

响应

HTTP 200

Successful response.

application/json

名称 类型 说明
total_count number Number of matching resources across pages; a lower bound when total_count_exact is false. With stack=true it counts edit trees, the rows the pages return, not the matching assets.
time number Elapsed search time in whole milliseconds.
next_cursor string Continuation token for the next page; omitted when no further page is available.
resources array<object> Assets in this page, ordered by sort_by; tags and context follow with_field.
resources[].asset_id string Generated asset identifier: 32 lowercase hexadecimal characters, preserved across overwrites.
resources[].public_id string Delivery identifier unique within this library, used in asset URLs.
resources[].display_name string Human-readable asset name, independent of its delivery identifier.
resources[].asset_folder string Organizational folder path; the empty string denotes the root folder.
resources[].type string Asset delivery mode: upload is public; authenticated requires a signed URL or delivery token for originals and derivatives. private is unsupported.
resources[].format string Detected file format used as the delivery URL extension.
resources[].version number Monotonically increasing asset version used in delivery URLs; based on upload time in Unix seconds and advanced on overwrite.
resources[].version_id string Identifier for this asset version, regenerated on overwrite.
resources[].bytes number Size of the original source content, in bytes.
resources[].etag string MD5 digest of the source bytes, as 32 lowercase hexadecimal characters.
resources[].width number Source image or video width in pixels, when known.
resources[].height number Source image or video height in pixels, when known.
resources[].duration number Source audio or video duration in seconds, when known.
resources[].pages number Number of pages recorded for the asset; omitted when no page count is stored.
resources[].audio object Detected audio track metadata, omitted when no audio track information is available.
resources[].has_audio boolean False when the video is known to contain no audio track; omitted when audio presence is unknown or an audio track exists.
resources[].original_filename string Original or overridden source filename with its final extension removed.
resources[].tags array<string> Labels attached to the asset.
resources[].context object Custom string metadata; omitted when empty or excluded by the search projection.
resources[].created_at string Time this asset identity was created, in UTC.
resources[].url string URL for retrieving this version of the asset’s original content.
resources[].secure_url string HTTPS delivery URL for this asset version; equal to url. For authenticated assets the URL carries a single-file token that expires after 15 minutes, so it is ready to use but must not be stored; keep asset_id and read the asset again. Request a delivery_tokens token for transformed URLs.
resources[].placeholder boolean False because this response represents stored source content.
resources[].existing boolean True when overwrite is false and the public_id already exists; the existing resource is returned.
resources[].library_id string Identifier of the library containing this asset.
resources[].sha256 string SHA-256 digest of the source bytes, as 64 lowercase hexadecimal characters.
resources[].status string Resource status; active identifies an asset that has not been deleted.
resources[].processing object Progress of understanding and embedding tasks for the asset.
resources[].has_alpha boolean True when the source header declares an alpha channel: a PNG color type 4 or 6 or a tRNS chunk, a WebP VP8X alpha flag or VP8L alpha bit, a WebM or MKV video track AlphaMode of 1, or a GIF transparent-color flag. False when a known container has no alpha channel. Omitted when the format is unknown, the header could not be parsed, or the asset was stored before this field existed; absence does not mean the source is opaque.
resources[].semantic string Search-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[].preview object Generated video previews, present once preview generation succeeds.
resources[].generation object Source details for the video-generation job that created this asset.
resources[].material_type string What this asset is as a reusable material. Always present; a file whose specific kind cannot be identified is file.
resources[].audio_role string What an audio asset is used for when material_type is audio: voice, music or sfx. An audio material uploaded without a declared role gets one inferred from its content once audio understanding finishes; a declared role is never replaced. Omitted for assets that are not audio materials.
resources[].animated boolean True when an image asset contains animation, such as an animated GIF or animated WebP. Omitted for assets that are not animated images.
resources[].derived_from string | null Asset this one was edited from; null when it was generated or uploaded rather than edited. Use assets.lineage for the whole tree.
resources[].root_id string Asset at the root of this asset’s edit tree; equals asset_id when this asset is itself a root. Omitted on assets stored before this field existed.
resources[].ai_generated boolean True when the bytes carry an AI-generated content label and this asset was produced by a model. False for uploaded and imported assets.
resources[].provenance object How this asset was generated or edited, including the model, prompt and references. Omitted on uploaded, imported and legacy assets.
resources[].viewer_url string Console page that shows this asset in the media library: https://console.deepraxis.com/media/&#123;library_id&#125;?asset_id=&#123;asset_id&#125; (the console host carries the environment, for example console-develop on develop). Give this link to a person instead of the bare asset_id.
resources[].colors array<object> Dominant colours of an analysed image or sticker, largest share first, at most five: hex is lower-case #rrggbb and ratio is that colour’s share of the opaque pixels (0 to 1). Returned by assets.get once the visual step has run; omitted for videos, assets not yet analysed and listings.
resources[].phash string 64-bit perceptual hash of an analysed image or sticker, 16 lower-case hexadecimal characters. Two images within hamming distance 6 are the same picture re-encoded or resized. Omitted until the visual step has run.
resources[].duplicates object Other live assets in this library holding the same picture, returned by assets.get only. exact lists assets with the same bytes, oldest first; similar lists images whose perceptual hash is within distance 6 but whose bytes differ, closest first. Each list holds at most 20; the field is omitted when both are empty. Nothing is merged or blocked: decide whether to keep, delete or tag them.
resources[].used_by_elements array<string> Live elements of this library (character, product, scene or brand) whose body still names this asset as a reference picture, logo or font, returned by assets.get only. It is exactly the list the delete endpoint answers as dependents; the field is omitted when there are none. Nothing is blocked: an element keeps working until its own body stops naming the asset.
resources[].duplicate_of string On an upload or import, the earliest live asset in this library that already holds exactly these bytes. Informational only: the new asset was still created. Tell the person the library already has it and give them that asset.
resources[].stack_count number Present only when stacking was requested with stack=true on the list or the expression search: how many live assets of this asset’s edit tree match the filters or expression, this one included. Open the tree with assets.lineage to see every step.
resources[].versions array<object> Present only when the asset was read with versions=true: the current bytes first, then the versions its library kept when uploads overwrote it, newest first. Empty of kept versions when the library’s backup setting was off.
aggregations object Requested facet counts, keyed by facet name and then by field value. They count matching assets even with stack=true, unlike total_count which then counts trees.
total_count_exact boolean Whether total_count covers all matches; false indicates a bounded partial count.
aggregations_exact boolean Whether the returned facet counts cover all matching assets.
终端窗口
curl -X POST "https://api.deepraxis.com/media/v1/libraries/${LIBRARY_ID}/search/expression" \
-H "Authorization: Bearer $PRAXIS_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"expression":"material_type:image AND tags=docs"}'

HTTP 200

{
"total_count": 1,
"total_count_exact": true,
"time": 208,
"resources": [
{
"asset_id": "2c25673fd03c41929a22fe860b33d920",
"public_id": "docs/pixel",
"display_name": "Sample image",
"asset_folder": "examples",
"type": "authenticated",
"format": "png",
"version": 1794550605,
"version_id": "8b9feb1e071f40858396419a66a4d512",
"bytes": 403,
"etag": "3506470cee1eb3f6ce4df4767d0cfef8",
"width": 128,
"height": 128,
"original_filename": "file",
"created_at": "2026-11-13T06:16:45.114Z",
"url": "https://media.praxisusercontent.com/lib_200f2b495e5f456194e746d66a3a8999/image/authenticated/v1794550605/docs/pixel.png?__cld_token__=st%3D1794550609%7Eexp%3D1794551509%7Eacl%3D%252Flib_200f2b495e5f456194e746d66a3a8999%252Fimage%252Fauthenticated%252Fv1794550605%252Fdocs%252Fpixel.png%7Ehmac%3De6d89fb9f32efc445d747dc49d2a7a84768085a13b9c421466dadb8e6d66e324",
"secure_url": "https://media.praxisusercontent.com/lib_200f2b495e5f456194e746d66a3a8999/image/authenticated/v1794550605/docs/pixel.png?__cld_token__=st%3D1794550609%7Eexp%3D1794551509%7Eacl%3D%252Flib_200f2b495e5f456194e746d66a3a8999%252Fimage%252Fauthenticated%252Fv1794550605%252Fdocs%252Fpixel.png%7Ehmac%3De6d89fb9f32efc445d747dc49d2a7a84768085a13b9c421466dadb8e6d66e324",
"placeholder": false,
"library_id": "lib_200f2b495e5f456194e746d66a3a8999",
"sha256": "9b5d2bc0516a2749576352b9c38c6e9f88d2db423d8a187c1c003034b2136b3c",
"status": "active",
"processing": {
"state": "pending",
"kinds": {
"visual": "pending",
"embedding": "pending"
},
"updated_at": "2026-11-13T06:16:45.114Z"
},
"semantic": "pending",
"has_alpha": false,
"material_type": "image",
"root_id": "2c25673fd03c41929a22fe860b33d920",
"viewer_url": "https://console.deepraxis.com/media/lib_200f2b495e5f456194e746d66a3a8999?asset_id=2c25673fd03c41929a22fe860b33d920"
}
]
}

以图搜图

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

参数 位置 类型 说明
library_id path string 库 ID

请求体

字段 类型 必填 说明
asset_id AssetId 否 素材 ID
image object 否 查询图片对象,data 为 base64,mime 为图片类型
top_k integer 否 命中数,1–50
filter string 否 表达式筛选条件

返回: 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

名称 类型 说明
hits array<object> Ranked assets up to top_k; an empty array means no eligible matches were found.
hits[].asset object Asset matched by the query.
hits[].score number Ranking score: cosine similarity for semantic or visual search; normalized rank-fusion score for hybrid search. Higher values rank first; hybrid scores are not probabilities or confidence.
hits[].semantic_score number | null Cosine similarity for hybrid hits with a semantic match; null for keyword-only hybrid hits. Omitted outside hybrid mode.
hits[].matches array<object> Supporting content or metadata matches contributing to this asset’s hit.
hits[].similar_count number How many other assets in this library matched as the same footage (the same file, or another export of the same Cut project) and were folded into this hit.
hits[].similar_asset_ids array<string> Asset ids folded into this hit, up to 10.
embedding_producer string Embedding model identifier used for the query, or for the source asset embedding in an asset-based visual query.
not_ready_excluded number Number 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_id path string 库 ID

请求体

字段 类型 必填 说明
query string 是 用自然语言描述要找的内容
filter string 否 表达式筛选条件
top_k integer 否 命中数,1–50
mode hybrid / semantic 否 hybrid 结合关键词与语义;semantic 仅语义
material_type MaterialType 否 —

返回: 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

名称 类型 说明
hits array<object> Ranked assets up to top_k; an empty array means no eligible matches were found.
hits[].asset object Asset matched by the query.
hits[].score number Ranking score: cosine similarity for semantic or visual search; normalized rank-fusion score for hybrid search. Higher values rank first; hybrid scores are not probabilities or confidence.
hits[].semantic_score number | null Cosine similarity for hybrid hits with a semantic match; null for keyword-only hybrid hits. Omitted outside hybrid mode.
hits[].matches array<object> Supporting content or metadata matches contributing to this asset’s hit.
hits[].similar_count number How many other assets in this library matched as the same footage (the same file, or another export of the same Cut project) and were folded into this hit.
hits[].similar_asset_ids array<string> Asset ids folded into this hit, up to 10.
embedding_producer string Embedding model identifier used for the query, or for the source asset embedding in an asset-based visual query.
not_ready_excluded number Number 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.
终端窗口
curl -X POST "https://api.deepraxis.com/media/v1/libraries/${LIBRARY_ID}/search/semantic" \
-H "Authorization: Bearer $PRAXIS_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"query":"a small image","top_k":5}'

HTTP 200

{
"hits": [],
"embedding_producer": "qwen3-vl-embedding",
"not_ready_excluded": 0
}

语义检索别名

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

参数 位置 类型 说明
library_id path string 库 ID

请求体

字段 类型 必填 说明
query string 是 用自然语言描述要找的内容
filter string 否 表达式筛选条件
top_k integer 否 命中数,1–50
mode hybrid / semantic 否 hybrid 结合关键词与语义;semantic 仅语义
material_type MaterialType 否 —

返回: SemanticSearchResult.

响应

HTTP 200

Successful response.

application/json

名称 类型 说明
hits array<object> Ranked assets up to top_k; an empty array means no eligible matches were found.
hits[].asset object Asset matched by the query.
hits[].score number Ranking score: cosine similarity for semantic or visual search; normalized rank-fusion score for hybrid search. Higher values rank first; hybrid scores are not probabilities or confidence.
hits[].semantic_score number | null Cosine similarity for hybrid hits with a semantic match; null for keyword-only hybrid hits. Omitted outside hybrid mode.
hits[].matches array<object> Supporting content or metadata matches contributing to this asset’s hit.
hits[].similar_count number How many other assets in this library matched as the same footage (the same file, or another export of the same Cut project) and were folded into this hit.
hits[].similar_asset_ids array<string> Asset ids folded into this hit, up to 10.
embedding_producer string Embedding model identifier used for the query, or for the source asset embedding in an asset-based visual query.
not_ready_excluded number Number 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.
终端窗口
curl -X POST "https://api.deepraxis.com/media/v1/libraries/${LIBRARY_ID}/search" \
-H "Authorization: Bearer $PRAXIS_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"query":"sample","top_k":5}'

HTTP 200

{
"hits": [
{
"asset": {
"asset_id": "0b189e47017149e5aea17955ada66d31",
"public_id": "examples/pixel",
"display_name": "pixel",
"asset_folder": "examples",
"type": "authenticated",
"format": "png",
"version": 1794550628,
"version_id": "eeb9e19cde004f5db8676dbf6d07ac7c",
"bytes": 403,
"etag": "3506470cee1eb3f6ce4df4767d0cfef8",
"width": 128,
"height": 128,
"original_filename": "file",
"tags": [
"docs"
],
"context": {
"custom": {
"alt": "sample"
}
},
"created_at": "2026-11-13T06:17:08.615Z",
"url": "https://media.praxisusercontent.com/lib_ab7c545e85994e108974c89aa2078cf8/image/authenticated/v1794550628/examples/pixel.png?__cld_token__=st%3D1794550633%7Eexp%3D1794551533%7Eacl%3D%252Flib_ab7c545e85994e108974c89aa2078cf8%252Fimage%252Fauthenticated%252Fv1794550628%252Fexamples%252Fpixel.png%7Ehmac%3D144fc3f86c3cf47f26e16411a2cd2dd7cbab34bcc953c808331eeead89cb2421",
"secure_url": "https://media.praxisusercontent.com/lib_ab7c545e85994e108974c89aa2078cf8/image/authenticated/v1794550628/examples/pixel.png?__cld_token__=st%3D1794550633%7Eexp%3D1794551533%7Eacl%3D%252Flib_ab7c545e85994e108974c89aa2078cf8%252Fimage%252Fauthenticated%252Fv1794550628%252Fexamples%252Fpixel.png%7Ehmac%3D144fc3f86c3cf47f26e16411a2cd2dd7cbab34bcc953c808331eeead89cb2421",
"placeholder": false,
"library_id": "lib_ab7c545e85994e108974c89aa2078cf8",
"sha256": "9b5d2bc0516a2749576352b9c38c6e9f88d2db423d8a187c1c003034b2136b3c",
"status": "active",
"processing": {
"state": "pending",
"kinds": {
"visual": "pending",
"embedding": "pending"
},
"updated_at": "2026-11-13T06:17:08.615Z"
},
"semantic": "pending",
"has_alpha": false,
"material_type": "image",
"root_id": "0b189e47017149e5aea17955ada66d31",
"viewer_url": "https://console.deepraxis.com/media/lib_ab7c545e85994e108974c89aa2078cf8?asset_id=0b189e47017149e5aea17955ada66d31"
},
"score": 1,
"matches": [
{
"kind": "metadata",
"understanding_id": null,
"segment": null,
"snippet": "pixel"
}
],
"semantic_score": null
}
],
"embedding_producer": "qwen3-vl-embedding",
"not_ready_excluded": 0
}

ExpressionSearchResult

字段 类型 必填 说明
total_count number 是 匹配总数
time number 是 检索耗时,整数毫秒,由服务端测得
next_cursor string 否 下一页游标;没有时为 null 或省略
resources SearchAsset[] 是 本页素材
aggregations object 否 按请求字段统计
total_count_exact boolean 否 计数是否精确
aggregations_exact boolean 否 统计是否精确

SemanticSearchResult

字段 类型 必填 说明
hits SemanticHit[] 是 检索命中
embedding_producer string 是 语义理解生成者
not_ready_excluded number 是 因未就绪而排除的素材数

SearchAsset

字段 类型 必填 说明
asset_id AssetId 是 素材 ID
public_id string 是 交付地址中的素材名称,可带路径
display_name string 是 显示名称
asset_folder string 是 组织文件夹;不改变 public_id。按它列出时只匹配这一层、不含子文件夹;空字符串表示根
type DeliveryType 是 资源或事件类型
format string 是 文件格式
version number 是 交付版本号
version_id string 是 版本标识
bytes number 是 文件字节数
etag string 是 文件校验标识
width number 否 宽度像素
height number 否 高度像素
duration number 否 时长秒数
pages number 否 文档页数
audio object 否 —
has_audio false 否 —
original_filename string 否 原文件名称
tags string[] 否 素材标签。上传可传逗号分隔字符串(每项去首尾空白、丢弃空项)、数组或重复的 tags 字段;PATCH 只接受数组并整体替换
context object 否 自定义文字键值;PATCH 整体替换,传 {} 清空
created_at IsoTimestamp 是 创建时间
url string 是 原文件地址
secure_url string 是 HTTPS 交付地址
placeholder false 是 固定为 false
existing boolean 否 未覆盖时是否返回已有素材
library_id LibraryId 是 库 ID
sha256 string 是 内容校验摘要
status "active" 是 资源状态
processing Processing 是 整体与各项理解状态
has_alpha boolean 否 —
semantic "pending" / "ready" / "unavailable" 是 ready 时可语义检索
preview object 否 预览海报和故事板
generation object 否 —
material_type MaterialType 是 —
audio_role AudioRole 否 —
animated true 否 —
derived_from AssetId / null 否 —
root_id AssetId 否 —
ai_generated boolean 否 —
provenance Provenance / RecordingProvenance 否 —
viewer_url string 否 —
colors AssetColor[] 否 —
phash string 否 —
duplicates AssetDuplicates 否 —
used_by_elements AssetId[] 否 —
duplicate_of AssetId 否 —
stack_count number 否 —
versions AssetVersion[] 否 —

SemanticHit

字段 类型 必填 说明
asset Asset 是 命中的素材
score number 是 相关度分数
semantic_score number / null 否 —
matches SemanticMatch[] 是 匹配内容与片段时间
similar_count number 否 —
similar_asset_ids string[] 否 —

SemanticMatch

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