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
{{ message }}
Repository navigation
Commit bb25424
Browse filesBrowse the repository at this point in the historyBrowse files
feat: add --fetch CLI argument for custom model pricing data sources
Add support for the --fetch flag that allows users to specify custom URLs or local file paths for model pricing data. This addresses issue #12 by enabling users behind corporate proxies to:
- Use custom HTTPS URLs for pricing data
- Load pricing data from local filesystem paths
- Bypass network restrictions when accessing pricing information
Changes:
- Add --fetch argument to shared CLI arguments
- Update PricingFetcher to accept custom data sources
- Support both HTTPS URLs and local file paths
- Update all commands (daily, monthly, session) to pass fetch parameter
- Update debug functionality to use custom pricing sources
- Maintain backward compatibility with default LiteLLM pricing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
-`-b, --breakdown`: Show per-model cost breakdown (splits usage by Opus, Sonnet, etc.)
224
+
-`-f, --fetch <source>`: Custom URL or local file path for model pricing data (supports HTTPS URLs and local filesystem paths)
224
225
-`-d, --debug`: Show pricing mismatch information for debugging
225
226
-`--debug-samples <number>`: Number of sample discrepancies to show in debug output (default: 5)
226
227
-`-h, --help`: Display help message
@@ -232,6 +233,41 @@ All commands support the following options:
232
233
-**`calculate`**: Always calculates costs from token counts using model pricing, ignores any pre-calculated `costUSD` values
233
234
-**`display`**: Always uses pre-calculated `costUSD` values only, shows $0.00 for entries without pre-calculated costs
234
235
236
+
#### Custom Pricing Data Source
237
+
238
+
The `--fetch` option allows you to specify a custom source for model pricing data instead of using the default LiteLLM pricing database:
239
+
240
+
-**HTTPS URLs**: Use `--fetch https://example.com/pricing.json` to fetch pricing data from a remote endpoint
241
+
-**Local files**: Use `--fetch /path/to/pricing.json` to load pricing data from a local JSON file
242
+
243
+
The pricing data should be in the same format as LiteLLM's pricing database:
**Note:** The `--fetch` option only affects cost calculations when using `calculate` or `auto` modes. In `display` mode, only pre-calculated `costUSD` values are used.
270
+
235
271
### MCP (Model Context Protocol) Support
236
272
237
273
Exposes usage data through Model Context Protocol for integration with other tools:
0 commit comments