file

Create asset reference from existing hash

Creates a new asset reference using an existing asset's hash. This avoids re-uploading the file content when the asset already exists in storage. The user can provide their own metadata and tags for the reference.

post/api/assets/from-hash

Request body

hashstring required

Hash of the existing asset. Supports Blake3 (blake3:) or SHA256 (sha256:) formats

mime_typestring

MIME type of the asset (e.g., "image/png", "video/mp4")

namestring

Display name for the asset reference (optional)

tagsstring[] required

Freeform tags for the asset. Common types include "models", "input", "output", and "temp", but any tag can be used in any order.

user_metadataobject

Custom metadata for this asset reference

Response

Asset reference created successfully

asset_hashstring

Deprecated: use hash instead. Blake3 hash of the asset content.

created_atstring date-time required

Timestamp when the asset was created

display_namestring nullable

Display name of the asset. Mirrors name for backwards compatibility.

hashstring

Blake3 hash of the asset content. Preferred over asset_hash.

idstring uuid required

Unique identifier for the asset

is_immutableboolean

Whether this asset is immutable (cannot be modified or deleted)

job_idstring uuid nullable

ID of the job that created this asset, if available

last_access_timestring date-time

Timestamp when the asset was last accessed

metadataobject

System-managed metadata from download sources (HuggingFace, CivitAI, etc.) - read-only, not user-modifiable

mime_typestring

MIME type of the asset

namestring required

Name of the asset file

preview_idstring uuid nullable

ID of the preview asset if available

preview_urlstring uri

URL for asset preview/thumbnail

sizeinteger

Size of the asset in bytes

tagsstring[]

Tags associated with the asset

updated_atstring date-time required

Timestamp when the asset was last updated

user_metadataobject

Custom user metadata for the asset

created_newboolean required

Whether this was a new asset creation (true) or returned existing (false)

Changes