Custom Label Support for Third-Party Models (e.g., Claude) in Vertex AI for Cost Breakdown

Hi everyone,

I’m currently using Vertex AI to access LLMs from third-party providers such as Claude. For cost analysis purposes, I would like to break down usage based on environment (e.g., prod, stage, dev) or business purpose.

I’ve noticed that Google’s Gemini models support custom metadata labels during generateContent and streamGenerateContent API calls, which are very helpful for filtering costs in billing reports.

However, I’d like to know:

  • Are custom labels also supported for third-party models like Claude?

  • If not, what is the recommended method to categorize or break down billing data based on purpose or environment for third-party model usage?

Any guidance or best practices would be greatly appreciated.

Thanks in advance!

2 Likes

Hello @paul5 ,

When using Vertex AI to access third-party models like Claude, categorizing costs by environment (e.g., prod, stage, dev) or business purpose requires alternative approaches, as Vertex AI’s custom metadata labels (supported for Gemini) are not available for external models. Below are Google-recommended methods to achieve cost transparency, along with supporting documentation.

  • Project-Level Separation

Approach: Create dedicated GCP projects for each environment (e.g., project-prod, project-dev) and apply labels.
Pros:

  • Native integration with GCP billing reports.
  • Clear isolation of costs.

Cons:

  • Increased management overhead.

Google Documentation:

Creating and Managing Projects

Project Labels for Billing

  • Vertex AI Endpoint Labels

Approach: Assign labels to endpoints hosting third-party models (e.g., env=prod).
Pros:

  • Costs appear under Vertex AI → Endpoints in billing reports.

Cons:

  • Requires separate endpoints per use case.

Google Documentation:

à Custom Logging + BigQuery

Approach: Log usage metadata (e.g., environment, tokens) and export to BigQuery for analysis.
Pros:

  • Granular, per-request tracking.

Cons:

  • Manual pipeline setup.

Google Documentation:

For most users, project separation or endpoint labels offer the best balance of simplicity and billing integration. For advanced use cases, custom logging provides finer granularity. Always reference Google’s official documentation for updates to labeling and billing features.

Best regards,

Suwarna