diff --git a/src/khoj/interface/web/chat.html b/src/khoj/interface/web/chat.html
index 07253b06..cba6eb2d 100644
--- a/src/khoj/interface/web/chat.html
+++ b/src/khoj/interface/web/chat.html
@@ -50,9 +50,7 @@
document.getElementById("chat-input").value = "";
// Generate backend API URL to execute query
- url = type_ === "chat"
- ? `/api/beta/chat?q=${encodeURIComponent(query)}`
- : `/api/beta/summarize?q=${encodeURIComponent(query)}`;
+ url = `/api/beta/${type_}?q=${encodeURIComponent(query)}`;
// Call specified Khoj API
fetch(url)
@@ -112,8 +110,8 @@