refresh-json-data
БесплатноБез исполняемых скриптовНе проверенRefresh token estimator and model pricing JSON files with latest data from AI model providers
от rajbos★ 127 звёзд на GitHubОб этом скилле
Refresh JSON Data Skill
This skill helps you update the token estimation ratios and model pricing data in the AI Engineering Fluency extension.
Overview
The extension uses two JSON data files that need periodic updates:
- tokenEstimators.json - Character-to-token ratio estimators for AI models
- modelPricing.json - Pricing information per million tokens for various AI models
These files are located in src/ directory and are bundled into the extension at build time.
When to Use This Skill
Use this skill when you need to:
- Add support for new AI models
- Update token estimation ratios based on new benchmarks
- Refresh pricing information from provider APIs
- Keep model data current with latest releases
Prerequisites
Before updating these files, ensure you have:
- Access to official pricing documentation from AI providers
- Token estimation benchmarks or documentation
- The repository cloned locally
- Node.js and pnpm installed
Step 1: Update tokenEstimators.json
Location
src/tokenEstimators.json
Structure
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Character-to-token ratio estimators for different AI models.",
"estimators": {
"model-name": 0.25
}
}
Update Process
Research token ratios for new or updated models:
- Look at the existing ratios for that provider's other models in
tokenEstimators.jsonand match the pattern; verify with an actual tokenizer if unsure
- Look at the existing ratios for that provider's other models in
Add or update entries in the
estimatorsobject:"new-model-name": 0.25Validation:
- Ensure JSON syntax is valid
- Keep ratio values between 0.20 and 0.30
- Use consistent formatting
Step 2: Update modelPricing.json
Location
src/modelPricing.json
Structure
{
"$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"
}
}
}
Update Process
Check official pricing pages:
- OpenAI: https://openai.com/api/pricing/
- Anthropic: https://www.anthropic.com/pricing (also https://platform.claude.com/docs/en/about-claude/pricing)
- Google Gemini: https://ai.google.dev/gemini-api/docs/pricing
- xAI Grok: https://x.ai/api
- Mistral AI: https://pricepertoken.com/pricing-page/provider/mistral-ai (aggregator, updated ~daily)
- Cross-reference with https://openrouter.ai/mistralai and https://ai-pricing.info/mistral
- Note: Mistral does not publish a single stable pricing page; use aggregators
- GitHub Copilot Models: https://docs.github.com/en/copilot/reference/ai-models/supported-models
- GitHub Copilot Premium Requests: https://docs.github.com/en/copilot/managing-copilot/monitoring-usage-and-entitlements/about-premium-requests
- OpenRouter (cross-provider verification): https://openrouter.ai
Update pricing entries in the
pricingobject:"model-name": { "inputCostPerMillion": 1.25, "outputCostPerMillion": 10.0, "category": "Provider models" }Update metadata:
- Set
metadata.lastUpdatedto current date (YYYY-MM-DD format) - Add or update source URLs and retrieval dates
- Keep the disclaimer intact
- Set
Pricing guidelines:
- Costs are per million tokens
- Input costs are typically lower than output costs
- Group models by category (e.g., "GPT-4 models", "Claude models")
- Verify pricing is in USD
Validation:
- Ensure JSON syntax is valid
- Verify pricing values are positive numbers
- Check that all required fields are present
Step 3: Build and Test
Validate JSON syntax, run pnpm run compile && pnpm run test:node (do not
launch VS Code or the Extension Development Host — that is a manual,
human-only debugging step; see AGENTS.md), review
with git diff, then commit/push as usual.
Important Notes
- Bundled at build time: These JSON files are bundled into the extension during compilation via
esbuild.js - Rebuild required: Always run
pnpm run compileafter changes - Pricing disclaimer: GitHub Copilot pricing may differ from direct API usage
- Estimation nature: Token counts are estimates based on character ratios
- Documentation: See
src/README.mdfor additional details
Reference Resources
- VS Code extension development: https://code.visualstudio.com/api
- Token estimation methodology: Character-to-token ratios based on model tokenizers
- Cost calculation: Uses 50/50 split between input and output tokens for estimates
Troubleshooting
**Extension not
Установить refresh-json-data в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл refresh-json-data?
Refresh token estimator and model pricing JSON files with latest data from AI model providers
Как установить скилл refresh-json-data?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл refresh-json-data запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic