You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(xai): add dynamic model discovery with correct pricing
- Implemented dynamic model discovery for xAI provider using /v1/language-models endpoint
- Models are now fetched at runtime with real-time pricing and capabilities
- Fixed pricing conversion: XAI API returns fractional cents (basis points), divide by 10,000 not 100
- This fixes pricing display showing $20.00 instead of $0.20 per 1M tokens
- Removed static xAI models from MODELS_BY_PROVIDER to rely on dynamic discovery
- Enhanced error logging with detailed status and URL information
- Support dynamic model context window overrides from API
- Fixed parseApiPrice to handle zero values correctly (for free models)
- Provided complete ModelInfo fallback in useSelectedModel for UI type safety
- Added comprehensive test coverage for cost utilities and XAI fetcher
- Updated all tests to reflect correct pricing scale and dynamic model behavior
0 commit comments