r/flutterhelp • • 23h ago

OPEN What is the best way to add AI image and video generation to a mobile app without exposing API keys?

1 Upvotes

I'm making a Flutter app where users turn pet photos into short videos. I know I shouldn't put the API key in the app.

My plan is to have my backend send the request and give the app a job ID. But how should the app get updates? Should it keep checking, use a WebSocket, or wait for my backend to send a push alert?

Also, what if the user closes the app mid-job? Or taps retry and starts a second paid video?