| summary | read_when | ||
|---|---|---|---|
Vertex AI provider data sources: gcloud ADC credentials and Cloud Monitoring quota usage. |
|
- OAuth via gcloud ADC (only path used in
fetch()):- Reads
application_default_credentials.jsonfrom the gcloud config directory. - Uses Cloud Monitoring time-series metrics to compute quota usage.
- Reads
- Authenticate:
gcloud auth application-default login. - Project:
gcloud config set project PROJECT_ID. - Fallback project env vars:
GOOGLE_CLOUD_PROJECT,GCLOUD_PROJECT,CLOUDSDK_CORE_PROJECT.
- Cloud Monitoring timeSeries:
- Usage:
serviceruntime.googleapis.com/quota/allocation/usage - Limit:
serviceruntime.googleapis.com/quota/limit - Resource:
consumer_quotawithservice="aiplatform.googleapis.com".
- Usage:
- Matches usage + limit series by quota metric + limit name + location.
- Reports the highest usage percent across matched series.
- Displayed as "Quota usage" with period "Current quota".
Vertex AI Claude usage is logged to the same local files as direct Anthropic API usage (~/.claude/projects/). CodexBar identifies Vertex AI entries using two methods:
-
Model name format (primary): Vertex AI uses
@as version separator- Vertex AI:
claude-opus-4-5@20251101 - Anthropic API:
claude-opus-4-5-20251101
- Vertex AI:
-
Metadata fields (fallback): Entries with provider metadata
metadata.provider: "vertexai"- Keys containing
vertexorgcp
To see Vertex AI token costs:
- Enable the Vertex AI provider in Settings → Providers
- Enable "Show cost summary" in Settings → General
- Use Claude Code with Vertex AI (your
cvalias setsANTHROPIC_MODEL=claude-opus-4-5@20251101)
Note: The model name must include the @ format for detection to work. If Claude Code normalizes model names to - format when logging, the entries won't be distinguishable from direct Anthropic API usage.
- No quota data: Ensure Cloud Monitoring API access in the selected project.
- No cost data: Check that
~/.claude/projects/exists and contains.jsonlfiles from Claude Code usage with Vertex AI metadata. - Auth issues: Re-run
gcloud auth application-default login.