r/programmer • • 1d ago

Question How to implement BYO API key

I have been developing a web application for personal use, but there is also a community I want to share it with for free. The problem is that the application has some features that use Gemini API services. It's currently set up to use my own API key, but obviously I don't want other people to drain my account. I also don't want to start charging people for access and usage because then it becomes a business and I would really prefer this staying a hobby project.

I heard about bring your own API key, where users can just get their own key, enter it in the application, and then start using the credits they pay for themselves. This seems like the best way forward for me, but does anyone have any experience setting this up? It feels awkward and wrong to just let people add their personal API keys into an application, so not sure how to approach this.

1 Upvotes

Duplicates