-
Hello, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, you can do that by creating a An alternate solution would be to host a proxy server where the API key is set in that server. Then, you can set the |
Beta Was this translation helpful? Give feedback.
Hi, you can do that by creating a
.env
file in the root directory. Then, you set theVITE_OPENAI_API_KEY
(see .env.example for more details). Then rebuild the app and your local server will be preloaded with the API key. However, do note that by doing so, your API key will be exposed to anyone who uses your website. This would not be an issue if it is hosted on your private server.An alternate solution would be to host a proxy server where the API key is set in that server. Then, you can set the
VITE_CUSTOM_API_ENDPOINT
andVITE_DEFAULT_API_ENDPOINT
to that proxy server. In this way, your API is not exposed to the users using your website. You can learn how to set up your own proxy server …