feat: cost analytics types, audit meters, and client methods#1134
Merged
feat: cost analytics types, audit meters, and client methods#1134
Conversation
- AuditAction: add inference, embedding, image_generation actions
- AuditMeter: generic { category, type, quantity } metering on audit events
- AuditTrailEvent: add meters[] and details (JSON) fields
- BILLABLE_AUDIT_ACTIONS constant for cost query filtering
- CostAnalyticsQuery/Response types for cost dashboard
- Client: getCostAnalytics() and getGlobalCostAnalytics() methods
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7af3eb4 to
d82ccd8
Compare
…to feat/cost-dashboard
d82ccd8 to
8842b4b
Compare
cmorman89
approved these changes
Apr 3, 2026
New Permission.billing_read = "billing:read" for viewing cost/usage data. Separate from manage_billing (Stripe management). Developer role gets it by default (not in the delete list). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Refactor to sync Promise executor with async init() helper. Fixes lint: "Promise executor functions should not be async" Also improves error handling — unhandled rejections now properly propagate via init().catch(reject). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…to feat/cost-dashboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CostAnalyticsQueryandCostAnalyticsResponsetypes to@vertesia/common{category, type, quantity}) toAuditTrailEventBILLABLE_AUDIT_ACTIONSconstant for filtering inference/embedding eventsbilling_readpermission for cost analytics accessCostApiclient methods:getAnalytics(),getGlobalAnalytics(),getExportUrl()interactiontogroup_byoptions,scope(project/org),pricing_source(list/historical)Test plan
@vertesia/commonand@vertesia/clientpackagesCostApimethods against deployed dev environment🤖 Generated with Claude Code