M-x set-variable chatgpt-shell-[something]-key is failing for me with the error in title. I've tried both openai and anthropic, obtaining the same error.
EDIT: I'm using chatgpt-shell version 20250722.81, from melpa.
The work around is to set variables with something like setq, M-x customize-set-variable, or edit init.el directly.