vertex-ai-usage
Query Vertex AI token usage from GCP Cloud Monitoring.
vertex-ai-usage [profile=NAME] [from=DATETIME] [to=DATETIME] [duration=PERIOD] [span=SPAN]
- profile=NAME
- Optional. GCP Vertex AI connect profile name
- from=DATETIME
- Optional. Start time (yyyyMMddHHmmss)
- to=DATETIME
- Optional. End time (yyyyMMddHHmmss)
- duration=PERIOD
- Optional. Relative duration (e.g. 7d, 30d)
- span=SPAN
- Optional. Alignment period (e.g. 10s, 1m, 5m, 10m, 1h, 1d). Auto-selected based on query range if omitted.
Output Fields
| Field | Type | Name | Description |
|---|---|---|---|
| _time | Date | Time | Interval start time (alias of start_time) |
| profile | String | Profile | Connect profile name |
| project_id | String | Project ID | GCP project ID |
| location | String | Location | GCP region (e.g. global, us-central1) |
| publisher | String | Publisher | Model publisher (e.g. google) |
| model | String | Model | Model ID (e.g. gemini-2.0-flash-exp, imagen-3.0-generate-002) |
| token_type | String | Token Type | Token type (e.g. input, output) |
| count | Long | Count | Token count |
| request_type | String | Request Type | Request type (e.g. shared) |
| duration | Long | Duration (s) | Interval duration in seconds |
| start_time | Date | Start Time | Interval start time |
| end_time | Date | End Time | Interval end time |