Skip to main content

Publishing Static Resources

In addition to AI agents, you can register static resources (files, datasets, documents) as payment-protected content. This allows you to monetize access to files, datasets, models, or any static content through the Nevermined protocol.

Overview of Static Resources

Static resource agents are specialized agent registrations that provide access to files and documents instead of interactive AI services. They work identically to regular agents but are optimized for static content delivery. Use Cases:
  • Premium datasets (CSV, JSON, Parquet files)
  • Trained ML models (PyTorch, TensorFlow checkpoints)
  • Documents and reports (PDF, DOCX)
  • Media files (images, audio, video)
  • Configuration files and templates
  • API specifications and documentation

Register Static Resource Agents

Static resources are registered using the same Agents API, but with HTTP GET endpoints pointing to your content URLs:

Using Wildcards for Multiple Files

You can use wildcards to grant access to multiple files with a single endpoint pattern:

Single Wildcard

This pattern allows access to:
  • https://storage.example.com/datasets/weather/2024-data.csv
  • https://storage.example.com/datasets/weather/hourly-readings.json
  • https://storage.example.com/datasets/climate/temperature-records.csv

Multiple Wildcards

This pattern allows access to:
  • https://storage.example.com/datasets/weather/2024/january.csv
  • https://storage.example.com/datasets/climate/2023/summer.json

File Type Wildcards

Examples

Example 1: Dataset Collection

Example 2: Model Repository

Example 3: Document Library

Example 4: Directory-Level Access

MCP Logical URIs for Static Resources

When registering static resource agents in the Nevermined App, you can also use MCP logical URIs with wildcards:

Access Control

Static resources use the same X402 access token authentication as AI agents:
  1. Subscribers order a plan and receive credits
  2. Subscribers generate an X402 access token
  3. Requests to static resources include the token in the payment-signature header
  4. Your server verifies the token and grants access
  5. Credits are burned based on your plan configuration
See Validation of Requests for implementation details.

Best Practices

  1. Organized Structure: Use clear URL patterns with logical path segments
  2. Wildcard Strategy: Balance flexibility (broad wildcards) with security (specific patterns)
  3. File Types: Specify file extensions in patterns when possible (e.g., *.csv, *.pdf)
  4. Preview Access: Consider providing free samples via openEndpoints
  5. Metadata Tags: Include file types and categories in tags for discoverability
  6. Plan Configuration: Set appropriate credits per download based on file size/value

Complete Example: Multi-Format Resource Library


Source References:
  • src/api/agents-api.ts (Agents API for static resources)
  • RUN.md (MCP logical URIs with wildcards)