Let users use their own Google Cloud account for TTS
It should be possible to make RTMS use a service account that can bill to subordinate accounts. This would allow me to run a persistent RTMS server and only pay for storage, rather than the expensive TTS bills too.
The flow would roughly be:
- User makes a Google Cloud account just like in Getting Started
- User logs into RTMS and is presented with a special authentication link
- User clicks the link, which will take them to GCP and ask if they want to give access to their TTS API key. User clicks OK
- User returns to RTMS and can use it on their own dime.
A quote from someone more knowledgeable:
You should just run the thing on either Cloud Run or a GCP VM that has ambient rotated credentials the metadata api (you can tell it that you want the app to have access to the service account and it will provide short-lived credentials automatically) Then they just give you the project name and you can access the API with your service account and it'll be billed to them And if you host on GCP or federate auth with AWS, you can avoid having any persistent API credentials at all Nothing about that would require vendor lock-in, Cloud Run just runs a container image and you can run whatever you want however you want on a GCE VM
And some helpful links:
https://cloud.google.com/iam/docs/service-accounts#short-lived-credentials
https://cloud.google.com/iam/docs/service-accounts#google-managed-keys
https://cloud.google.com/run/docs/securing/service-identity