#398·Upsonic

[FEATURE] Dynamic Pricing Information

Author: samitugalCreated Jul 25, 2025Updated Jan 28, 2026
Labelsfeature

Is your feature request related to a problem? Please describe.

The current static pricing system in MODEL_REGISTRY has several critical issues:

  1. Outdated pricing data - Many models have incorrect or obsolete pricing information
  2. Phantom models - Non-existent models like openai/gpt-4.5-preview with pricing ($75/1M) that cause user errors
  3. Limited model coverage - Only 25 static models vs 320+ available on OpenRouter
  4. Manual maintenance - Requires code updates for every pricing change or new model
  5. No real-time validation - Users get confused by models that don't actually exist

Example: openai/gpt-4.5-preview shows expensive static pricing but the model was removed by OpenAI.

Describe the solution you'd like

Implement a hybrid dynamic pricing system that:

  1. Primary: Fetch real-time pricing from OpenRouter API (320+ models)
  2. Fallback: Use static pricing when API is unavailable
  3. Performance: 3-second timeout with 24-hour caching and auto-refresh
  4. Extended support: Handle advanced pricing (image, cache, reasoning costs)
  5. Agent integration: Automatically initialize dynamic pricing when agents start

Key features:

  • Real-time model availability detection
  • Comprehensive fuzzy matching for model names
  • Extended pricing fields (image: $0.024, cache_read: $1.5/1M)
  • Silent operation (no debug prints)
  • Thread-safe caching with automatic refresh