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

"Please enter a valid API key" error on valid keys #12

Open
cjaccino opened this issue May 29, 2024 · 1 comment
Open

"Please enter a valid API key" error on valid keys #12

cjaccino opened this issue May 29, 2024 · 1 comment

Comments

@cjaccino
Copy link

When first using the application, the user is prompted to provide an API key. However the application refuses the key.

Probably due to the 51-character check. The current API-keys I'm getting are 56-character, probablying owing to the introduction of "proj-" in the new keys and the change in how OpenAI is managing them.

  const handleSave = () => {
    if (apiKey.length !== 51) {
      alert("Please enter a valid API key.");
      return;
    }

Line 103 of "components/Search.tsx" above is likely the culprit.

@devanshamin
Copy link

Legacy User API Keys are of length 51 while the project API keys are of length 56,
image

Update the Search.tsx accordingly.

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