[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:
- Outdated pricing data - Many models have incorrect or obsolete pricing information
- Phantom models - Non-existent models like
openai/gpt-4.5-previewwith pricing ($75/1M) that cause user errors - Limited model coverage - Only 25 static models vs 320+ available on OpenRouter
- Manual maintenance - Requires code updates for every pricing change or new model
- 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:
- Primary: Fetch real-time pricing from OpenRouter API (320+ models)
- Fallback: Use static pricing when API is unavailable
- Performance: 3-second timeout with 24-hour caching and auto-refresh
- Extended support: Handle advanced pricing (image, cache, reasoning costs)
- 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
Source: Upsonic/Upsonic