Billing for multiple users of google cloud APIs on one GCP project

I have one GCP project and multiple users/service accounts that use the google cloud APIs (e. g. Cloud text-to-speech, Cloud speech-to-text etc.). In the metrics overview for each API it is possible to see how often an API has been called by whom, but for the billing overview, it is not possible to identify which user/service account caused a specific amount of costs. So my question is: Is it possible to identify the different users/service accounts in the actual billing costs?

I am looking for native or neat way to accomplish this, without mapping the metrics data to the billing data. Also, I want to avoid using multiple projects for each user/service account

Normally, one would use labels to distinguish between different users, but unfortunately labels are not supported for those APIs (see list of currently supported services: https://cloud.google.com/resource-manager/docs/creating-managing-labels#label_support)

Additionally, each user/service account has a separate Cloud run instance connected to it, that runs a server listening for incoming requests and forwards them to the corresponding API. Would this approach somehow facilitates the mapping from user to costs in one GCP project?


Solution 1:

I will add a little bit to the answer from the stack question:

  • You can use metrics to analyze the distribution and split the cost accordingly;
  • Since billing is done on project level you can create more projects (this is how Google recommends setting up your GCP organization);
  • Finally, you can create a Feature Request to have more detailed billing information.