Replies: 2 comments
-
One of the best ways to handle secrets in emacs, in general, is |
Beta Was this translation helpful? Give feedback.
-
You can put (setq gptel-api-key "sk-blahblabblah...") in your gptel configuration. But then the key will be visible in your config, which is unsafe. Instead, you can do (setq gptel-api-key (getenv "OPENAI_API_KEY")) and make sure that this environment variable is available to Emacs. If your API keys are stored in a password manager of some kind, you can do (setq gptel-api-key (lambda () (shell-command-to-string "my-password-get api.openai.com"))) where But the best way to do it would be to use the |
Beta Was this translation helpful? Give feedback.
-
Hi there, thanks for this awesome package!
I am just setting it up, and I wanted to start with using GPT as a model. When looking at docs in the readme, for setting up ChatGPT, they say to procure the OpenAI API key, which makes sense, but then the only other thing is "Optional: set gptel-api-key" and two bullet points below it. This confused me, due to the "Optional" part -> I assumed this means that it can work without this, probably pulling it in directly from the
OPENAI_API_KEY
env var. But it seems like that is not happening. It did ask me interactively for the GPT API Key, but that lasted only for the current emacs session. So what is the recommended way to do it? Thanks!Beta Was this translation helpful? Give feedback.
All reactions