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.
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 type | Typical use |
|---|---|
| Images | Generate product visuals, illustrations, mockups, or edited images from a prompt |
| Audio | Create speech clips or transcribe speech input |
| Video | Generate 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
| Field | Description |
|---|---|
id | Unique asset identifier (KSUID) |
workspace_id | Workspace the asset belongs to |
execution_id | Execution that generated the asset |
agent_id | Agent that generated the asset |
type | audio, image, or video |
provider | Media provider, such as elevenlabs or fal |
file_name | Original or generated file name |
file_size | Size in bytes |
content_type | MIME type, such as image/png or audio/mpeg |
storage_key | S3 object key |
metadata | Additional metadata, such as model or prompt |
created_at | Creation 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:
| Variable | Description |
|---|---|
STORAGE_ENDPOINT | S3-compatible endpoint URL |
STORAGE_REGION | Storage region |
STORAGE_BUCKET | Bucket name |
STORAGE_ACCESS_KEY_ID | Access key ID |
STORAGE_SECRET_KEY | Secret access key |
STORAGE_PUBLIC_URL | Public URL prefix for assets |
STORAGE_FORCE_PATH_STYLE | Use 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 generationstt-- Speech-to-text transcriptionimage_gen-- Image generation from a text promptimage_edit-- Image editing with a promptvideo_gen-- Video generation from a text promptvideo_from_image-- Video generation from an image and prompt
Providers
Available providers depend on the configured tool templates and workspace credentials.
| Category | Example providers |
|---|---|
| Speech | ElevenLabs, Deepgram |
| Image | Fal, Replicate, Stability AI |
| Video | Runway, 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 operationsimage-- Image generation and editingvideo-- Video generation
Each span can include provider, model, prompt, output URL, asset URL, content type, duration, and estimated cost.
Related Topics
- 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