Skip to content

Usage & Billing

jorsm edited this page May 29, 2026 · 3 revisions

Usage & Billing

Track your local Vertex AI usage and estimated costs inside VS Code.

Table of Contents

Local dashboard

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.

Status bar indicators

The extension displays your daily usage and authentication status in the VS Code status bar (typically at the bottom right).

Cost Display

The status bar shows Today: $X.XX representing the total estimated cost for the current day.

Authentication Icons

The icon next to the cost changes based on your active authentication method:

  • $(cloud) (Cloud): Using standard gcloud Application 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.

Detailed Tooltip

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).

Cost estimation

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.

Billing warning

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
}

Persistent usage logs

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

Google Cloud Billing link

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

When to use the dashboard

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?

Clone this wiki locally