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

How do I get my api key? #115

Open
kanodiaayush opened this issue Aug 21, 2024 · 3 comments
Open

How do I get my api key? #115

kanodiaayush opened this issue Aug 21, 2024 · 3 comments

Comments

@kanodiaayush
Copy link

I'm trying to find my api key on codeium.com but cannot. Where should I look?

@kanodiaayush
Copy link
Author

I see the following error trace. This is upon M-x codeium-install. The binary seems to be downloaded correctly, but I think its trying to authenticate after that, and that doesn't work. I'm in doom emacs.

Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 3) 5)
  read-multiple-choice("No Codeium API key found. Authenticate manually or..." ((manual "manual") (auto "auto")) nil nil t)
  codeium-background-process-start(#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/var/folders/nr/y8jh5f217h7_l72v6rygyx100000gn/T/c..." :port 54434 :port-ready-hook nil :alive-tracker default43 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x49d35837> :pending-table #<hash-table eql 0/65 0x49d35b31>))
  codeium-install-process-url-res(#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/var/folders/nr/y8jh5f217h7_l72v6rygyx100000gn/T/c..." :port 54434 :port-ready-hook nil :alive-tracker default43 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x49d35837> :pending-table #<hash-table eql 0/65 0x49d35b31>) "https://github.com/Exafunction/codeium/releases/do..." #<killed buffer> "/Users/akanodia/doom-emacs/.local/cache/codeium/co...")
  #f(compiled-function () #<bytecode 0x4d1f4c4aafec772>)()
  apply(#f(compiled-function () #<bytecode 0x4d1f4c4aafec772>) nil)
  codeium-defer-until-no-input(#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/var/folders/nr/y8jh5f217h7_l72v6rygyx100000gn/T/c..." :port 54434 :port-ready-hook nil :alive-tracker default43 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x49d35837> :pending-table #<hash-table eql 0/65 0x49d35b31>) default43 #f(compiled-function () #<bytecode 0x4d1f4c4aafec772>) nil)
  apply(codeium-defer-until-no-input (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/var/folders/nr/y8jh5f217h7_l72v6rygyx100000gn/T/c..." :port 54434 :port-ready-hook nil :alive-tracker default43 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x49d35837> :pending-table #<hash-table eql 0/65 0x49d35b31>) default43 #f(compiled-function () #<bytecode 0x4d1f4c4aafec772>) nil))
  timer-event-handler([t 26309 16944 560398 nil codeium-defer-until-no-input (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/var/folders/nr/y8jh5f217h7_l72v6rygyx100000gn/T/c..." :port 54434 :port-ready-hook nil :alive-tracker default43 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x49d35837> :pending-table #<hash-table eql 0/65 0x49d35b31>) default43 #f(compiled-function () #<bytecode 0x4d1f4c4aafec772>) nil) nil 0 nil])

@svetlyak40wt
Copy link

Encountered the similar error on GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu) of 2022-05-31:

Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 3) 5)
  read-multiple-choice("No Codeium API key found. Authenticate manually or..." ((manual "manual") (auto "auto")) nil nil t)
  (car (read-multiple-choice "No Codeium API key found. Authenticate manually or..." '((manual "manual") (auto "auto")) nil nil t))
  (let* ((login-method (car (read-multiple-choice "No Codeium API key found. Authenticate manually or..." '((manual "manual") (auto "auto")) nil nil t))) (authurl (codeium-make-auth-url codeium-state nil login-method))) (if (eq login-method 'auto) (progn (browse-url authurl) (codeium-request 'GetAuthToken state nil #'(lambda (res) (let* (...) (if token ... ...)) (codeium-background-process-schedule state))) (message "you can also use M-x codeium-kill-last-auth-url to...")) (kill-new authurl) (progn (or (progn (and (memq (type-of state) cl-struct-codeium-state-tags) t)) (signal 'wrong-type-argument (list 'codeium-state state))) (let* ((v state)) (aset v 8 (read-string (format "%s has been copied to clipboard.\nAfter you login, ..." authurl))))) (codeium-background-process-schedule state)))
  (cond ((and (progn (or (progn (and (memq ... cl-struct-codeium-state-tags) t)) (signal 'wrong-type-argument (list 'codeium-state state))) (aref state 3)) (not (process-live-p (progn (or (progn ...) (signal ... ...)) (aref state 3))))) (codeium-reset state)) ((and (not (codeium-get-config 'codeium-port nil state)) (not (codeium-get-config 'codeium-directory nil state)) (not (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... state))) (aref state 3)))) (progn (or (progn (and (memq (type-of state) cl-struct-codeium-state-tags) t)) (signal 'wrong-type-argument (list 'codeium-state state))) (let* ((v state)) (aset v 5 nil))) (let* ((dir (and t (progn (or ... ...) (aref state 4))))) (if dir (progn (delete-directory dir t) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 4 nil)))) nil)) (codeium-create-process state) (codeium-background-process-schedule state)) ((not (codeium-get-config 'codeium-port nil state)) (if (codeium-get-config 'codeium-directory nil state) nil (error "no manager directory defined")) (let ((files (directory-files (codeium-get-config 'codeium-directory nil state) nil "^[[:digit:]]*$"))) (if files (progn (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 5 ...))) (mapc #'(lambda ... ...) (progn (or ... ...) (aref state 6))))) (codeium-background-process-schedule state))) ((and (not (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... state))) (aref state 8))) (not (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... state))) (aref state 9))) (not (codeium-get-config 'codeium/metadata/api_key 'GetCompletions state))) (let* ((login-method (car (read-multiple-choice "No Codeium API key found. Authenticate manually or..." '... nil nil t))) (authurl (codeium-make-auth-url codeium-state nil login-method))) (if (eq login-method 'auto) (progn (browse-url authurl) (codeium-request 'GetAuthToken state nil #'(lambda ... ... ...)) (message "you can also use M-x codeium-kill-last-auth-url to...")) (kill-new authurl) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... state))) (let* ((v state)) (aset v 8 (read-string ...)))) (codeium-background-process-schedule state)))) ((and (not (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... state))) (aref state 9))) (not (codeium-get-config 'codeium/metadata/api_key 'GetCompletions state))) (codeium-request 'RegisterUser state nil #'(lambda (res) (let* ((key ...)) (if key (progn ... ...) (error "cannot get api_key from res"))) (codeium-background-process-schedule state)))) (t (codeium-request 'Heartbeat state nil #'(lambda (_res) (codeium-run-with-timer state 5 #'codeium-background-process-start state)))))
  codeium-background-process-start(#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>))
  apply(codeium-background-process-start #s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>))
  (let ((inhibit-quit nil)) (apply func args))
  (condition-case nil (let ((inhibit-quit nil)) (apply func args)) (quit (setq quit-flag t) (eval '(ignore nil))))
  (if (input-pending-p) (run-with-idle-timer 0.005 nil #'codeium-defer-until-no-input state tracker func args) (condition-case nil (let ((inhibit-quit nil)) (apply func args)) (quit (setq quit-flag t) (eval '(ignore nil)))))
  (progn (if (input-pending-p) (run-with-idle-timer 0.005 nil #'codeium-defer-until-no-input state tracker func args) (condition-case nil (let ((inhibit-quit nil)) (apply func args)) (quit (setq quit-flag t) (eval '(ignore nil))))))
  (if (eq tracker (progn (or (progn (and (memq (type-of state) cl-struct-codeium-state-tags) t)) (signal 'wrong-type-argument (list 'codeium-state state))) (aref state 7))) (progn (if (input-pending-p) (run-with-idle-timer 0.005 nil #'codeium-defer-until-no-input state tracker func args) (condition-case nil (let ((inhibit-quit nil)) (apply func args)) (quit (setq quit-flag t) (eval '(ignore nil)))))))
  codeium-defer-until-no-input(#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>) default612 codeium-background-process-start (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>)))
  apply(codeium-defer-until-no-input (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>) default612 codeium-background-process-start (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>))))
  timer-event-handler([t 26386 53620 986393 nil codeium-defer-until-no-input (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>) default612 codeium-background-process-start (#s(codeium-state :name "default" :config nil :proc #<process codeium> :manager-directory "/tmp/codeium_d2yOJS" :port 38897 :port-ready-hook nil :alive-tracker default612 :last-auth-token nil :last-api-key nil :last-request-id 0 :results-table #<hash-table eql 0/65 0x16b5cdb> :pending-table #<hash-table eql 0/65 0x1770599>))) nil 645000 nil])

@avdv
Copy link
Contributor

avdv commented Nov 12, 2024

I am not seeing an error, but also I am not asked for an api token / key...

Sadly, I had to use neovim, running :Codeium Auth as outlined here and extracted the API key from ~/.codeium/config.json and added it to my init file with (setq codeium/metadata/api_key "...").

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

3 participants