Reduce cost of idol time while waiting for API response

I have a mobile app that uses google cloud functions to call the OpenAI API (in order to keep the api key secure.) Everything works fine, but the cost is incredibly high while the cloud function waits for the OpenAI response. Basically, the cloud function is "on" in idol mode for a good 8-10 seconds every time it is invoked while it waits for a reply. This is costing me a ton in google cloud time, and I'm wondering if anyone else has come up with a simple solution to limit this expense?

5 0 48
0 REPLIES 0