The demo is easy. Wire a model to a text box and it looks like magic. The product is harder, and almost all of the difficulty is in three places.
First, the key. It belongs on your server, always. If the browser can see it, someone will find it and spend your money. Every request from the client goes to your backend, which adds the key and forwards it.
Second, the cost. Work out the price per request before you launch, not after the first invoice. For ChatCubie's assistant I capped context length and cached common answers, which cut spend by roughly 60%.
Third, the boundaries. A model will happily answer questions about anything. Give it a system prompt that says what it is for, and reject the rest politely. Users trust a tool that admits limits more than one that guesses.
The assistant now handles about half of all support messages, and the ones it passes on arrive with a summary attached.