with one click
refresh-json-data
// Refresh token estimator and model pricing JSON files with latest data from AI model providers
// Refresh token estimator and model pricing JSON files with latest data from AI model providers
| name | refresh-json-data |
| description | Refresh token estimator and model pricing JSON files with latest data from AI model providers |
This skill helps you update the token estimation ratios and model pricing data in the Copilot Token Tracker extension.
The extension uses two JSON data files that need periodic updates:
These files are located in src/ directory and are bundled into the extension at build time.
Use this skill when you need to:
Before updating these files, ensure you have:
src/tokenEstimators.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Character-to-token ratio estimators for different AI models.",
"estimators": {
"model-name": 0.25
}
}
Research token ratios for new or updated models:
Add or update entries in the estimators object:
"new-model-name": 0.25
Common model families and their ratios:
Validation:
src/modelPricing.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Model pricing data - costs per million tokens",
"metadata": {
"lastUpdated": "YYYY-MM-DD",
"sources": [
{
"name": "Provider Name",
"url": "https://pricing-url",
"retrievedDate": "YYYY-MM-DD"
}
],
"disclaimer": "..."
},
"pricing": {
"model-name": {
"inputCostPerMillion": 1.25,
"outputCostPerMillion": 10.0,
"category": "Model category"
}
}
}
Check official pricing pages:
Update pricing entries in the pricing object:
"model-name": {
"inputCostPerMillion": 1.25,
"outputCostPerMillion": 10.0,
"category": "Provider models"
}
Update metadata:
metadata.lastUpdated to current date (YYYY-MM-DD format)Pricing guidelines:
Validation:
After updating the JSON files:
Validate JSON syntax:
# Check JSON is valid
node -e "require('./src/tokenEstimators.json')"
node -e "require('./src/modelPricing.json')"
Rebuild the extension:
npm run compile
Test in VS Code:
Review changes:
git diff src/tokenEstimators.json
git diff src/modelPricing.json
Stage the files:
git add src/tokenEstimators.json src/modelPricing.json
Commit with descriptive message:
git commit -m "Update model pricing and token estimators
- Updated pricing for [model names]
- Added support for [new models]
- Refreshed data from provider APIs as of [date]"
Push and create PR:
git push origin your-branch-name
esbuild.jsnpm run compile after changessrc/README.md for additional detailsJSON validation errors:
Build failures after update:
Extension not loading updated data:
npm run compile# 1. Update the JSON files with new data
code src/tokenEstimators.json
code src/modelPricing.json
# 2. Validate JSON syntax
node -e "require('./src/tokenEstimators.json')" && echo "tokenEstimators.json: OK"
node -e "require('./src/modelPricing.json')" && echo "modelPricing.json: OK"
# 3. Rebuild the extension
npm run compile
# 4. Test in VS Code
# Press F5 to launch Extension Development Host
# 5. Commit changes
git add src/tokenEstimators.json src/modelPricing.json
git commit -m "Update model pricing data for 2026-01"
git push origin update-model-data
The extension reads these files at compile time via:
import tokenEstimatorsData from './tokenEstimators.json';
import modelPricingData from './modelPricing.json';
The data is then used in the CopilotTokenTracker class:
tokenEstimators - Used for token estimation from character countsmodelPricing - Used for cost calculations in the details panelBoth files must maintain their structure to ensure the extension compiles and runs correctly.
[HINT] Download the complete skill directory including SKILL.md and all related files