PromptRails

Assets and Media

Use media tools inside agents and keep generated audio, images, video, and files traceable as workspace assets.

Assets are the files an agent creates while it works: generated images, audio clips, transcripts, videos, or other file outputs. Media generation now happens through tools attached to an agent, and the generated file is stored as an asset so the team can inspect it, download it, and trace it back to the run that produced it.

Use this page when you need to understand where generated media lives, how it connects to a trace, and what happens after a media tool runs.

How Media Fits Into a Run

Media is not a separate execution mode. An agent calls a media tool during its normal workflow.

1Agent Run
2Media Tool Call
3Generated File
4Workspace Asset
5Trace Evidence

That gives the team one place to answer practical questions:

  • Which agent produced this file?
  • Which prompt, tool, provider, and model were used?
  • Was the media generation step successful?
  • What did it cost and how long did it take?
  • Can someone download or clean up the output later?

What Can Be Generated

Media capability depends on the tools and credentials attached to the agent.

Media typeTypical use
ImagesGenerate product visuals, illustrations, mockups, or edited images from a prompt
AudioCreate speech clips or transcribe speech input
VideoGenerate short video assets from text or image inputs

Provider choice is configured through the tool and its credential. PromptRails keeps the output connected to the execution instead of leaving it as an external provider URL with no product context.

Where Assets Show Up

Generated assets are connected to the execution that created them. Reviewers can inspect the run in Tracing, see the media span, then download the asset when needed.

An asset record keeps:

  • The workspace, agent, and execution that produced the file
  • The media type, provider, content type, and file metadata
  • The storage reference and download path
  • Provider/model metadata when available
  • The creation time for audit and cleanup workflows

Managing Assets

Most teams use asset management for three jobs:

  • Review -- confirm a generated image, clip, transcript, or video is the expected output.
  • Download -- hand the output to another system, person, or workflow.
  • Cleanup -- remove files that are no longer needed.

Deleting an asset removes the stored file and its metadata record. Historical traces still show that the run happened, but the file itself is no longer available.

Technical detailsAsset API and storage details

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, such as elevenlabs or fal
file_nameOriginal or generated file name
file_sizeSize in bytes
content_typeMIME type, such as image/png or audio/mpeg
storage_keyS3 object key
metadataAdditional metadata, such as model or prompt
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 through signed URLs with configurable expiration:

signed = client.assets.get_signed_url(asset_id="your-asset-id")
print(signed["url"])

Deleting Assets

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

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.

Technical detailsMedia provider and trace details

Tool Capabilities

Media tools can support:

  • tts -- Text-to-speech generation
  • stt -- Speech-to-text transcription
  • image_gen -- Image generation from a text prompt
  • image_edit -- Image editing with a prompt
  • video_gen -- Video generation from a text prompt
  • video_from_image -- Video generation from an image and prompt

Providers

Available providers depend on the configured tool templates and workspace credentials.

CategoryExample providers
SpeechElevenLabs, Deepgram
ImageFal, Replicate, Stability AI
VideoRunway, Pika, Luma

Video Polling

Video generation is asynchronous. When a video job is submitted, PromptRails polls the provider for completion in the background. Once the video is ready, the generated asset is downloaded and stored in the workspace asset store.

Trace Spans

Media tool calls appear in execution traces with media-specific span metadata:

  • speech -- TTS and STT operations
  • image -- Image generation and editing
  • video -- Video generation

Each span can include provider, model, prompt, output URL, asset URL, content type, duration, and estimated cost.

  • MCP Tools -- Attach tools to agents
  • Credentials -- Set up media provider credentials
  • Tracing -- Inspect media spans in execution traces
  • Executions -- Follow the run that produced an asset