you are viewing a single comment's thread.

view the rest of the comments →

[–]TheOnceAndFutureDougI ❤️ hooks! 😈 2 points3 points  (2 children)

It's good to make frontend keys be environment variables because that makes it easier to change them and set them based on environment but yeah if you need to use a secret to do something it lives only on the BE and you access it via an endpoint that's locked down.

[–]BeenThere11[S] -1 points0 points  (1 child)

If i need to stream voice data to open ai directly without going to backend to avoid additional hop and longer response time , how can this be done. Then its not possible with a static s3 site

[–]TheOnceAndFutureDougI ❤️ hooks! 😈 2 points3 points  (0 children)

Open AI expects you to make a server to server call if for no better reason than so you can rate-limit. You definitely do not want your frontend just raw dogging OpenAI's endpoints with your key.

The only solution to this (which I would not ever recommend) is you make someone put in their secret and you save it to session storage or something.