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

Unable to Set OpenAI API Key #258

Open
1 task
RayChang opened this issue Dec 1, 2023 · 4 comments
Open
1 task

Unable to Set OpenAI API Key #258

RayChang opened this issue Dec 1, 2023 · 4 comments
Labels
bug Something isn't working pending triage

Comments

@RayChang
Copy link

RayChang commented Dec 1, 2023

Bug description

I reinstalled aicommits globally using pnpm (8.11.0) and added the OpenAI_KEY in the settings. However, when I attempted to make a git commit using aicommits, I encountered an OpenAI API Error: 401 - Unauthorized message.

2023-12-01 11 30 27

Expected Behavior: Should be able to generate commit messages normally through aicommits.

aicommits version

1.11.0

Environment

System:
  OS: macOS 14.1.1
  CPU: Apple M1 Max
  Shell: /bin/zsh (5.9)
Binaries:
  Node: v18.18.2 ~/.nvm/versions/node/v18.18.2/bin/node
  npm: 9.8.1 ~/.nvm/versions/node/v18.18.2/bin/npm
  pnpm: 8.11.0 /opt/homebrew/bin/pnpm

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.
@RayChang RayChang added bug Something isn't working pending triage labels Dec 1, 2023
@jchinkle
Copy link

I am encountering this bug too. When I use aicommits config set to set the API key, it sets it in the .aicommits file in my home directory. However, it is not preferring that setting over an ENV variable. I have an ENV variable set (OPENAI_KEY) that is empty string, and it is attempting to use that instead of the value set in .aicommits.

@KrustyHack
Copy link

Ay,

I have the same issue and I still can't find from where the OPENAI_KEY variable is set. And .aicommits config does not seem to be taken into account with my new OpenAI API key.

@xyNNN
Copy link

xyNNN commented May 26, 2024

What's the state about this issue? I'm having the same issue and can't identify where the OPENAI_KEY is defined.

@xyNNN
Copy link

xyNNN commented May 26, 2024

Okay, for which reason it was configured with export OPENAI_KEY=XYZ in my .zshrc ... nevermind ;)
A grep --recursive 'sk-XYZ' ./ helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage
Projects
None yet
Development

No branches or pull requests

4 participants