Skip to content

sarumaj/kagi-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kagi-proxy

Proxy service for © kagi.com. © Kagi offers a search engine as payware which is less vigilantly subjected to questionable SEO practices. Furthermore, it offers AI assistant service. The AI assistant ships most recent available GPT solutions under one subscription, e.g.:

  • Anthropic: Claude 3.5 Sonnet
  • OpenAI: GPT 4o
  • Google: Gemini Pro
  • Meta: Llama 3

Refer to help.kagi.com for more information.

The subscription is around 25$ each month for both the unlimited search engine and AI assistant services. Family plan is provided as well, whereas the fee rounds up to 20$ base rate + 15$ for each member per month. More about pricing their official site: kagi.com/pricing. I wrote a simple proxy service to make my personal © Kagi subscription shareable with my family only. I provide a reversed proxy behind TLS, basic authentication scheme, CSRF and DDoS protection by employing request throttling. I interfere with the kagi.com interface via DOM content mutation observation and JS injection to provide a seamless user experience.

Proxy is exposed behind kagi.sarumaj.com:

screenshot

In the case, you are interested to run the proxy yourself, you need to setup a VM in the cloud and configure DNS to support wildcard domains corresponding to *.kagi.com and kagi.com. The proxy web service is freely configurable via its CLI:

Usage of kagi-proxy:
  -limit-burst uint
        burst size for rate limiting (default 12)
  -limit-rps float
        requests per second for rate limiting (default 90)
  -port uint
        port to listen on (default 8080)
  -proxy-extra-policy string
        path to a JSON file with additional policy rules
  -proxy-host string
        proxy domain (default "kagi.com")
  -proxy-otp-secret string
        OTP encryption secret for the proxy session (default "test")
  -proxy-pass string
        proxy user password (default "pass")
  -proxy-session-secret string
        cookie encryption secret for the proxy session (default "test")
  -proxy-user string
        proxy user (default "user")
  -session-token string
        session token for the Kagi website