Is this open source? Is it local browser API calls, or routing through your server?
API calls are routed through a thin proxy on my side, this is how you get access to all the models with my API keys. I definitely would not want to store those keys in code of the JS bundle in the browser (:
Only if you want to spend more time managing an open source project than building a real world project. It is not easy and it can be a big distraction.