I want to create an app using Google Speech-to-Text API.
And this app will use StreamingRecognize
.
https://cloud.google.com/speech-to-text/docs/reference/rpc/google.cloud.speech.v1#google.cloud.speech.v1.Speech.StreamingRecognize
But I'm worried about cost overruns by some attacks.
e.g.) stolen api key, over execution ..etc
Suppose, if meeting these requirements, there is no problem.
StreamingRecognize
cannot be called without some billing by the user- One user can have only one connection with
StreamingRecognize
Could you tell me how to use this API secure?
App spec
Language: Flutter (Dart)
- will release App Store & Google Play
- will have billing system for a function using
StreamingRecognize
- will use
speechToText.streamingRecognize
https://github.com/felixjunghans/google_speech#and-finally-send-the-request-1 - will use Requests per 60 seconds* limitation for avoiding cost overruns temporary.
https://cloud.google.com/speech-to-text/quotas?hl=en
More Info:
Once I considered about this Android/iOS apps restriction,
https://cloud.google.com/docs/authentication/api-keys?visit_id=637405639528794487-3748827222&rd=1#api_key_restrictions
But I could not understand why it can be restricted.
- If an api key sets in app, this key can be stolen.
- Even if information is encrypted in client side, however, I think this information can be created by other client system
- If api key can be used outside app, there is no meaning restricting in app or billing system