pilotmoon / PopClip-Extensions

Source code for extensions in the official PopClip Extensions directory.
https://www.popclip.app/extensions/
MIT License
1.91k stars 438 forks source link

API Key Not Saving in Keychain - OpenAI Chat Extension #1252

Open peixinshen opened 1 month ago

peixinshen commented 1 month ago

Thank you for developing and maintaining this great extension!

I am using the "OpenAI Chat" extension with PopClip on MacOS Sequoia 15.1. Since the 2024-05-17 update (v133), where the API key is stored in the keychain, the API key cannot save properly. After entering the key in the settings, it appears blank when reopened. Using this extension warns: Message from OpenAl (code 401): You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth. I tried to revert the API key type from "secret" back to "string" in Config.ts and found that it resolved the issue.

Could this be a bug, or am I missing the correct way to store the API key in the keychain? Thanks for your help!

Florianismeandonlyme commented 1 month ago

Same Problem

ziegn commented 5 days ago

When I revert the API key type in Config.ts to string, I can't start this extension. My version of the extension is 244.