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

Error connecting openai Api #2

Closed
a2p0 opened this issue Jun 11, 2023 · 0 comments · Fixed by #4
Closed

Error connecting openai Api #2

a2p0 opened this issue Jun 11, 2023 · 0 comments · Fixed by #4
Labels
bug Something isn't working

Comments

@a2p0
Copy link
Owner

a2p0 commented Jun 11, 2023

Refused to set unsafe header "User-Agent"

According to openai/openai-node#6 :

This library is meant for server-side usage only, as using it in client-side browser code will expose your secret API key. See here for more details.
You should route your requests through a backend server that you control.

workaround for this exercice

delete configuration.baseOptions.headers['User-Agent'];
@a2p0 a2p0 added the bug Something isn't working label Jun 11, 2023
@a2p0 a2p0 linked a pull request Jun 11, 2023 that will close this issue
@a2p0 a2p0 closed this as completed in #4 Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant