Media

Search

Requests, objects, and responses.

expression accepts expressions; semantic and search accept natural language. Semantic search returns ready assets only.

Expression syntax

Guide →

Base URL and authentication

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

ParameterLocationTypeDescription
library_idpathstringLibrary ID

Request body

FieldTypeRequiredDescription
expressionstringnoStructured query expression; an empty expression returns every asset
sort_byobject[]noSort fields and directions
max_resultsintegernoUp to 500; Search defaults to 100, Admin to 10
next_cursorstringnoNext-page cursor; null or absent at the end
with_fieldtags / context[]noInclude tags or context
aggregateAggregateField[]noAggregation fields

Returns: ExpressionSearchResult.

Response

HTTP 200

Successful response.

application/json

NameTypeDescription
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

ParameterLocationTypeDescription
library_idpathstringLibrary ID

Request body

FieldTypeRequiredDescription
asset_idAssetIdnoAsset ID
imageobjectnoQuery image object: base64 data and image MIME type
top_kintegernoMaximum hits, 1–50
filterstringnoExpression filter

Returns: SemanticSearchResult.

Available when library search.image is true; unsupported libraries return LIBRARY_INVALID_STATE. JPEG, PNG, WebP and GIF are accepted, with a maximum decoded size of 10 MiB. Each asset returns its highest-scoring match; videos identify the best frame. qwen3-vl-embedding uses 0.35 for image similarity. Measurements on 2026-10-10: variants of the same image scored 0.82–0.96, similar scenes 0.38–0.66, and unrelated images at most 0.34.

Provide exactly one of asset_id or image: { data, mime }. Asset queries reuse existing image understanding and exclude the source asset; videos use the first frame. Incomplete understanding returns LIBRARY_INVALID_STATE. Uploaded image data is base64. top_k defaults to 20 and accepts 1–50; filter uses the semantic-search expression syntax. Only image similarity is searched. The response shares semantic search’s hits, embedding_producer and not_ready_excluded fields. matches.kind is image; snippet uses the latest caption or asset name. Deleted assets, old versions and replaced understanding are excluded.

Response

HTTP 200

Successful response.

application/json

NameTypeDescription
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

ParameterLocationTypeDescription
library_idpathstringLibrary ID

Request body

FieldTypeRequiredDescription
querystringyesDescribe what you want to find
filterstringnoExpression filter
top_kintegernoMaximum hits, 1–50
modehybrid / semanticnohybrid combines keywords and semantics; semantic uses semantics only

Returns: SemanticSearchResult.

With bge-m3, vector candidates must have cosine similarity ≥ 0.55 before keyword fusion, including newly understood content. Calibration on seven demo assets on 2026-10-09 found relevant results at approximately 0.58 or higher (0.581–0.729), irrelevant results at most 0.523, and wholly unrelated queries at most 0.478. qwen3-vl-embedding text queries use 0.40 against text content (captions, transcripts) and 0.25 against image content. Other models remain uncalibrated and unfiltered. Keyword matches are unaffected. Queries unrelated to the library return an empty list; mode=semantic returns only results meeting the vector threshold.

Response

HTTP 200

Successful response.

application/json

NameTypeDescription
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.

Semantic search alias

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

ParameterLocationTypeDescription
library_idpathstringLibrary ID

Request body

FieldTypeRequiredDescription
querystringyesDescribe what you want to find
filterstringnoExpression filter
top_kintegernoMaximum hits, 1–50
modehybrid / semanticnohybrid combines keywords and semantics; semantic uses semantics only

Returns: SemanticSearchResult.

Response

HTTP 200

Successful response.

application/json

NameTypeDescription
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

FieldTypeRequiredDescription
total_countnumberyesMatching count
timenumberyesSearch time in whole milliseconds, measured by the service
next_cursorstringnoNext-page cursor; null or absent at the end
resourcesSearchAsset[]yesAssets in this page
aggregationsobjectnoCounts by requested fields
total_count_exactbooleannoWhether the count is exact
aggregations_exactbooleannoWhether aggregations are exact

SemanticSearchResult

FieldTypeRequiredDescription
hitsSemanticHit[]yesSearch hits
embedding_producerstringyesSemantic understanding producer
not_ready_excludednumberyesAssets excluded because they are not ready

SearchAsset

FieldTypeRequiredDescription
asset_idAssetIdyesAsset ID
public_idstringyesAsset name in delivery URLs; may contain path segments
display_namestringyesDisplay name
asset_folderstringyesOrganizational folder; does not change public_id. Listing by it matches that level only, not subfolders; an empty string is the root
resource_typeResourceTypeyesimage, video (including audio), or raw; auto applies to uploads only, and listing with auto or any other value returns 400
typeDeliveryTypeyesResource or event type
formatstringyesFile format
versionnumberyesDelivery version
version_idstringyesVersion identifier
bytesnumberyesFile size in bytes
etagstringyesFile checksum
widthnumbernoWidth in pixels
heightnumbernoHeight in pixels
durationnumbernoDuration in seconds
pagesnumbernoDocument pages
is_audiobooleannoWhether this is audio
original_filenamestringnoOriginal file name
tagsstring[]noAsset tags. Uploads accept a comma-separated string (items trimmed, empty items dropped), an array, or repeated tags fields; PATCH accepts an array only and replaces the whole list
contextobjectnoCustom text key/value pairs; PATCH replaces the whole map, {} clears it
created_atIsoTimestampyesCreation time
urlstringyesOriginal-file URL
secure_urlstringyesHTTPS delivery URL
placeholderfalseyesAlways false
existingbooleannoWhether an existing asset was returned without overwrite
processingProcessingyesOverall and per-kind processing states
library_idLibraryIdyesLibrary ID
sha256stringyesContent checksum
status"active"yesResource status
semantic"pending" / "ready" / "unavailable"yesSearchable semantically when ready
previewobjectnoPreview poster and storyboard

SemanticHit

FieldTypeRequiredDescription
assetAssetyesMatching asset
scorenumberyesRelevance score
semantic_scorenumber / nullno—
matchesSemanticMatch[]yesMatched content and segment times

SemanticMatch

FieldTypeRequiredDescription
kindUnderstandingKind / "metadata" / "image"yesUnderstanding or processing kind; filters the understanding list
understanding_idUnderstandingId / nullyesUnderstanding ID; null for metadata matches
segmentSegment / nullyesStart/end milliseconds; null for whole assets
snippetstringyesMatching text snippet
Export

On this page