Is there a safe way to share my API token in 3rd party apps?

I’m writing a free app that uses OpenAI API, but I don’t want to eat the costs of the AI queries. I figured I could ask users to just input their own api tokens, but I don’t want to deal with saving them myself.

Besides, it always feels kinda sus when an app asks you to put in your own API token - feels like one of them will end up a scam that maxes out your account.

Any solutions/recommendations for this? Or do I just have to charge users separately and eat the cost of API requests?

You could store your key in an env variable for the application and set a quota on your application to prevent overuse. Thats the easiest way for a web application. Don’t forget to ask for donations.

Bonus: openai tokens are relatively cheap. But if your app garners fans, lookout!

Just save the api key on local browser or local device.
As my AI.LS does.

OP is trying to share the app without people entering their license key. No offense but I’d never put my key in your app, even though it looks like a nice app.

1 Like