@@ -1332,7 +1332,8 @@ class CopilotTokenTracker implements vscode.Disposable {
13321332 tooltip . appendMarkdown ( `📅 Today \n` ) ;
13331333 tooltip . appendMarkdown ( `| | |\n|-----------------------|-------|\n` ) ;
13341334 tooltip . appendMarkdown ( `| Tokens : | ${ detailedStats . today . tokens . toLocaleString ( ) } |\n` ) ;
1335- tooltip . appendMarkdown ( `| Estimated cost : | $ ${ detailedStats . today . estimatedCost . toFixed ( 4 ) } |\n` ) ;
1335+ tooltip . appendMarkdown ( `| Estimated cost (est.) : | $ ${ detailedStats . today . estimatedCost . toFixed ( 2 ) } |\n` ) ;
1336+ tooltip . appendMarkdown ( `| Estimated cost (TBB) : | $ ${ ( detailedStats . today . estimatedCostCopilot ?? 0 ) . toFixed ( 2 ) } |\n` ) ;
13361337 tooltip . appendMarkdown ( `| CO₂ estimated : | ${ detailedStats . today . co2 . toFixed ( 2 ) } grams |\n` ) ;
13371338 tooltip . appendMarkdown ( `| Water estimated : | ${ detailedStats . today . waterUsage . toFixed ( 3 ) } liters |\n` ) ;
13381339 tooltip . appendMarkdown ( `| Sessions : | ${ detailedStats . today . sessions } |\n` ) ;
@@ -1345,7 +1346,8 @@ class CopilotTokenTracker implements vscode.Disposable {
13451346 tooltip . appendMarkdown ( `📊 Last 30 Days \n` ) ;
13461347 tooltip . appendMarkdown ( `| | |\n|-----------------------|-------|\n` ) ;
13471348 tooltip . appendMarkdown ( `| Tokens : | ${ detailedStats . last30Days . tokens . toLocaleString ( ) } |\n` ) ;
1348- tooltip . appendMarkdown ( `| Estimated cost : | $ ${ detailedStats . last30Days . estimatedCost . toFixed ( 4 ) } |\n` ) ;
1349+ tooltip . appendMarkdown ( `| Estimated cost (est.) : | $ ${ detailedStats . last30Days . estimatedCost . toFixed ( 2 ) } |\n` ) ;
1350+ tooltip . appendMarkdown ( `| Estimated cost (TBB) : | $ ${ ( detailedStats . last30Days . estimatedCostCopilot ?? 0 ) . toFixed ( 2 ) } |\n` ) ;
13491351 tooltip . appendMarkdown ( `| CO₂ estimated : | ${ detailedStats . last30Days . co2 . toFixed ( 2 ) } grams |\n` ) ;
13501352 tooltip . appendMarkdown ( `| Water estimated : | ${ detailedStats . last30Days . waterUsage . toFixed ( 3 ) } liters |\n` ) ;
13511353 tooltip . appendMarkdown ( `| Sessions : | ${ detailedStats . last30Days . sessions } |\n` ) ;
@@ -1354,6 +1356,8 @@ class CopilotTokenTracker implements vscode.Disposable {
13541356 // Footer
13551357 tooltip . appendMarkdown ( '\n---\n' ) ;
13561358 tooltip . appendMarkdown ( '*Cost estimates based on actual input/output token ratios.* \n' ) ;
1359+ tooltip . appendMarkdown ( '*(est.) = provider API market rates, for reference only.* \n' ) ;
1360+ tooltip . appendMarkdown ( '*(TBB) = Copilot AI Credit rates — what Copilot will bill you.* \n' ) ;
13571361 tooltip . appendMarkdown ( '*Updates automatically every 5 minutes.*' ) ;
13581362
13591363 this . statusBarItem . tooltip = tooltip ;
@@ -1811,6 +1815,11 @@ class CopilotTokenTracker implements vscode.Disposable {
18111815 const lastMonthCost = this . calculateEstimatedCost ( lastMonthStats . modelUsage ) ;
18121816 const last30DaysCost = this . calculateEstimatedCost ( last30DaysStats . modelUsage ) ;
18131817
1818+ const todayCostCopilot = this . calculateEstimatedCost ( todayStats . modelUsage , 'copilot' ) ;
1819+ const monthCostCopilot = this . calculateEstimatedCost ( monthStats . modelUsage , 'copilot' ) ;
1820+ const lastMonthCostCopilot = this . calculateEstimatedCost ( lastMonthStats . modelUsage , 'copilot' ) ;
1821+ const last30DaysCostCopilot = this . calculateEstimatedCost ( last30DaysStats . modelUsage , 'copilot' ) ;
1822+
18141823 const result : DetailedStats = {
18151824 today : {
18161825 tokens : todayStats . tokens ,
@@ -1825,7 +1834,8 @@ class CopilotTokenTracker implements vscode.Disposable {
18251834 co2 : todayCo2 ,
18261835 treesEquivalent : todayCo2 / this . co2AbsorptionPerTreePerYear ,
18271836 waterUsage : todayWater ,
1828- estimatedCost : todayCost
1837+ estimatedCost : todayCost ,
1838+ estimatedCostCopilot : todayCostCopilot
18291839 } ,
18301840 month : {
18311841 tokens : monthStats . tokens ,
@@ -1840,7 +1850,8 @@ class CopilotTokenTracker implements vscode.Disposable {
18401850 co2 : monthCo2 ,
18411851 treesEquivalent : monthCo2 / this . co2AbsorptionPerTreePerYear ,
18421852 waterUsage : monthWater ,
1843- estimatedCost : monthCost
1853+ estimatedCost : monthCost ,
1854+ estimatedCostCopilot : monthCostCopilot
18441855 } ,
18451856 lastMonth : {
18461857 tokens : lastMonthStats . tokens ,
@@ -1855,7 +1866,8 @@ class CopilotTokenTracker implements vscode.Disposable {
18551866 co2 : lastMonthCo2 ,
18561867 treesEquivalent : lastMonthCo2 / this . co2AbsorptionPerTreePerYear ,
18571868 waterUsage : lastMonthWater ,
1858- estimatedCost : lastMonthCost
1869+ estimatedCost : lastMonthCost ,
1870+ estimatedCostCopilot : lastMonthCostCopilot
18591871 } ,
18601872 last30Days : {
18611873 tokens : last30DaysStats . tokens ,
@@ -1870,7 +1882,8 @@ class CopilotTokenTracker implements vscode.Disposable {
18701882 co2 : last30DaysCo2 ,
18711883 treesEquivalent : last30DaysCo2 / this . co2AbsorptionPerTreePerYear ,
18721884 waterUsage : last30DaysWater ,
1873- estimatedCost : last30DaysCost
1885+ estimatedCost : last30DaysCost ,
1886+ estimatedCostCopilot : last30DaysCostCopilot
18741887 } ,
18751888 lastUpdated : now
18761889 } ;
@@ -3825,8 +3838,8 @@ usageAnalysis: undefined
38253838 return { responseText, thinkingText, toolCalls, mcpTools } ;
38263839 }
38273840
3828- public calculateEstimatedCost ( modelUsage : ModelUsage ) : number {
3829- return _calculateEstimatedCost ( modelUsage , this . modelPricing ) ;
3841+ public calculateEstimatedCost ( modelUsage : ModelUsage , pricingSource : 'provider' | 'copilot' = 'provider' ) : number {
3842+ return _calculateEstimatedCost ( modelUsage , this . modelPricing , pricingSource ) ;
38303843 }
38313844
38323845
0 commit comments