khoj-ai / khoj

Your AI second brain. Get answers to your questions, whether they be online or in your own notes. Use online AI models (e.g gpt4) or private, local LLMs (e.g llama3). Self-host locally or use our cloud instance. Access from Obsidian, Emacs, Desktop app, Web or Whatsapp.
https://khoj.dev
GNU Affero General Public License v3.0
12k stars 595 forks source link

[FIX] Can not generate an API key #674

Closed anku94 closed 3 months ago

anku94 commented 4 months ago

Describe the bug

I can not figure out a way to generate an API key with Khoj 1.6.2.

The option is missing from http://localhost:42110/config#clients, and I'm not sure if this is the right API, but "GET /auth/token HTTP/1.1" is also returning 404 in the logs.

To Reproduce

Steps to reproduce the behavior: run either the main branch, or the docker image, or the pip package for this version

Screenshots

If applicable, add screenshots to help explain your problem.

Platform

If self-hosted

Additional context

Add any other context about the problem here.

debanjum commented 4 months ago

Hi @anku94, how did you start Khoj? You do not need to create Khoj API key if the Khoj server running in anonymous mode (i.e started khojwith --anonymous-mode flag). You can just point the client you want to use (e.g desktop, obsidian, emacs) to the Khoj server URL (usually at http://localhost:42110) and start chatting with it.

Let me know if you're facing some other issues with setting up Khoj? You can use the setup docs to self-host Khoj

anku94 commented 3 months ago

Sorry for the delayed response.

I looked up my Obsidian devtools console, and looks like my problem was being caused by a malformed url (localhost:42110, instead of http://localhost:42110, the former results in a network request to app://obsidian.md/localhost:42110/api/... - which is invalid).

I understand that this project is in its early stages, and the million ways in which users break things are not handled gracefully yet. Closing the issue for now!

debanjum commented 3 months ago

Ah I see, glad you solved the issue and thanks for being understanding!