-
Notifications
You must be signed in to change notification settings - Fork 2
Usage & Billing
Track your local Vertex AI usage and estimated costs inside VS Code.
The extension provides a built-in dashboard called Vertex AI Usage & Costs. It displays:
- Total estimated cost
- Total input and output tokens
- Most used model
- Cached token savings
- Cost and token charts
- Payload footprint analysis
- Per-model usage summary
Open the dashboard by clicking the Vertex AI cost status bar item in VS Code.
The extension displays your daily usage and authentication status in the VS Code status bar (typically at the bottom right).
The status bar shows Today: $X.XX representing the total estimated cost for the current day.
The icon next to the cost changes based on your active authentication method:
-
$(cloud) (Cloud): Using standard
gcloudApplication Default Credentials (ADC). - $(key) (Key): Using a Service Account stored in VS Code Secrets.
- $(file) (File): Using a local JSON key file path.
- $(pulse) (Pulse): Default/Initial state.
Hovering over the status bar item reveals a detailed tooltip containing:
- Today's Cost: Estimated total for the current UTC day.
- Project ID: The active GCP project ID and its Source (Workspace Setting, Global Setting, or Default).
- Auth Method: A description of how you are currently authenticated.
- Account Identity: The email address associated with the current session (if available).
Usage costs are estimated from the model pricing defined in the extension's models.json catalog.
The extension calculates cost using:
- input tokens
- output tokens
- cached read tokens
- cached create tokens
Each value is converted from tokens to dollars using the model pricing values and then summed.
Important: These are local cost estimates only. The final billed amount appears in the Google Cloud Billing Console.
The dashboard shows a warning banner by default to remind you that estimates are not the final invoice.
If you want to hide the warning permanently, enable:
{
"vertexAiChat.hideBillingWarning": true
}Usage data is stored locally in daily log files named YYYYMMDD.jsonl inside the extension's global storage directory.
Each log entry includes:
- timestamp
- model ID
- token usage breakdown
- calculated cost
The dashboard includes a direct link to your Google Cloud Billing page for the configured project.
This uses your vertexAiChat.projectId value to open:
https://console.cloud.google.com/billing?project=YOUR_PROJECT_ID
Use it to answer questions like:
- Which model is consuming the most tokens?
- How much did I spend today in estimated cost?
- How much of my requests were served from cache?
- Which timeframe should I inspect for unusual usage?