Real-time cloud and AI cost annotations inline in your VS Code editor. See the cost of every API call, model invocation, and cloud resource as you write code — no context switching required.
Features
- Inline cost annotations — per-call and monthly cost estimates rendered directly in the editor
- AI model pricing — supports OpenAI, Anthropic, and other major model providers
- AWS resource costs — Terraform file analysis with region-aware pricing
- Smart token estimation — estimates input/output tokens from your actual code
- Color-coded warnings — green / yellow / red thresholds so expensive calls stand out
- Hover details — hover over any annotation to see a full cost breakdown
Supported Languages
- TypeScript / JavaScript (
.ts,.tsx,.js,.jsx) - Terraform (
.tf)
Getting Started
- Install the extension from the VS Code Marketplace
- Open any supported file — annotations appear automatically
- Optionally add a
cloudmetric.config.jsonto your project root to customize behavior
Configuration
VS Code Settings
| Setting | Default | Description |
|---|---|---|
cloudmetric.enabled |
true |
Enable/disable annotations |
cloudmetric.monthlyRequestVolume |
100000 |
Assumed monthly calls for cost projections |
cloudmetric.region |
us-east-1 |
AWS region for region-specific pricing |
cloudmetric.showMonthlyEstimate |
true |
Show monthly estimate alongside per-call cost |
cloudmetric.config.json
Place this file in your project root for per-project overrides:
{
"region": "us-east-1",
"monthlyRequestVolume": 100000,
"tokenAssumptions": {
"defaultInputTokens": 500,
"defaultOutputTokens": 300,
"charsPerToken": 4
},
"ignorePaths": ["node_modules", "dist", ".next", "coverage"],
"enableTerraformAnalysis": true,
"debounceMs": 300,
"pricingOverrides": {}
}
Commands
| Command | Description |
|---|---|
CloudMetric: Analyze Current File |
Manually trigger analysis on the open file |
CloudMetric: Open Configuration |
Open the config file |
CloudMetric: Show All Warnings |
List all cost warnings in the Problems panel |
CloudMetric: Clear Annotations |
Remove all inline annotations |
License
MIT