Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Security with Proxy Server #184

Open
ppoh71 opened this issue Mar 21, 2024 · 2 comments
Open

API Security with Proxy Server #184

ppoh71 opened this issue Mar 21, 2024 · 2 comments

Comments

@ppoh71
Copy link

ppoh71 commented Mar 21, 2024

Documentation about how a proxy server can work with this client. Otherwise, it is not recommended to use this client, since you expose your API key in your client which will result in a compromised API Key and financial costs on your side. (Speaking out of experience)

The feature request:
A working example of secure server-side communication with a proxy server and openai and the macpaw/client

Context:

Since we all read this disclaimer:

⚠️ OpenAI strongly recommends developers of client-side applications proxy requests through a separate backend service to keep their API key safe. API keys can access and manipulate customer billing, usage, and organizational data, so it's a significant risk to expose.

I still deployed my app without a proxy and used the openai API directly in my app. After few days in the AppStore my API key got compromised and was used for by Chatgpt4 request. Luckily I had a set a limit and learned a lesson.

@SunburstEnzo
Copy link
Contributor

I'm really sorry to hear your API key was compromised; this is a really good idea and something I'd love to see added myself. Though I'm not a moderator I'll have a look at adding some helpful text, but feel free to add a basic PR and we'll build on it.

@ppoh71
Copy link
Author

ppoh71 commented Mar 22, 2024

please check the ongoing discussion here:
#116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants