PromptRails

Assets

Browse, manage, and download media assets generated by agent executions.

Assets

Assets are media files generated during agent executions -- audio from TTS, images from generation tools, and video from video providers. All assets are stored in S3-compatible storage and tracked with metadata for easy browsing and management.

Asset Properties

FieldDescription
idUnique asset identifier (KSUID)
workspace_idWorkspace the asset belongs to
execution_idExecution that generated the asset
agent_idAgent that generated the asset
typeaudio, image, or video
providerMedia provider (e.g., elevenlabs, fal)
file_nameOriginal or generated file name
file_sizeSize in bytes
content_typeMIME type (e.g., image/png, audio/mpeg)
storage_keyS3 object key
metadataAdditional metadata (model, prompt, etc.)
created_atCreation timestamp

Listing Assets

# List all assets
assets = client.assets.list()
 
# Filter by type
images = client.assets.list(type="image")
 
# Filter by provider
fal_assets = client.assets.list(provider="fal")
 
# Filter by execution
exec_assets = client.assets.list(execution_id="your-execution-id")

Downloading Assets

Assets are served via signed URLs with configurable expiration:

# Get a signed download URL
signed = client.assets.get_signed_url(asset_id="your-asset-id")
print(signed["url"])  # Temporary signed URL

Deleting Assets

client.assets.delete(asset_id="your-asset-id")

Deleting an asset removes the file from storage and the metadata record. This action is irreversible.

Storage Configuration

Asset storage uses S3-compatible backends. Configure via environment variables:

VariableDescription
STORAGE_ENDPOINTS3-compatible endpoint URL
STORAGE_REGIONStorage region
STORAGE_BUCKETBucket name
STORAGE_ACCESS_KEY_IDAccess key ID
STORAGE_SECRET_KEYSecret access key
STORAGE_PUBLIC_URLPublic URL prefix for assets
STORAGE_FORCE_PATH_STYLEUse path-style addressing (default: true)

Compatible with Railway Storage Buckets, MinIO, AWS S3, Cloudflare R2, and other S3-compatible services.