CLI tools that give any AI agent access to Kagi's search and AI APIs: web search, AI-synthesized answers, page summarization, and independent-web enrichment.
Works with any agent that can call shell commands: pi, Claude Code, Gemini CLI, Codex, Cursor, or your own custom agent.
Kagi is a user-funded search engine with no ads, no tracking, and no data selling. Because its revenue comes directly from users rather than advertisers, results are optimized for relevance and quality instead of engagement and ad clicks. That alignment matters a lot when you're feeding search results into an AI agent.
Kagi's own research shows that AI models perform up to 80% better when sourcing data through Kagi Search compared to ad-supported engines (source, blog). The results are cleaner, less polluted by SEO spam, and drawn from more authoritative sources. Kagi also runs its own non-commercial crawl indexes: Teclis surfaces high-quality content from smaller, independent sites that commercial indexes deprioritize, and TinyGem covers alternative and independent news sources. On top of that, Kagi offers a built-in summarizer API that works on any URL, PDF, or raw text, and uses simple pay-per-use pricing with no quota tiers or subscription traps.
| Tool | What it does | Kagi API | Price |
|---|---|---|---|
| kagi-search | Web search + page content extraction | Search | $0.025 / query |
| kagi-fastgpt | AI answer synthesized from live web search | FastGPT | $0.015 / query |
| kagi-summarizer | Summarize any URL, PDF, or text block | Summarizer | $0.030 / 1k tokens ($0.025 on Ultimate plan) |
| kagi-enrich | Search the independent web (Teclis) and alt-news (TinyGem) | Enrichment | $0.002 / query |
- Create a Kagi account at https://kagi.com/signup
- Go to Settings → API → https://kagi.com/settings?p=api
- Generate a token and add credit
- Export the key in your shell profile:
# bash/zsh
export KAGI_API_KEY="your-api-key-here"
# fish
set -Ux KAGI_API_KEY "your-api-key-here"One key works for all four tools.
- Set your API key (see Get an API Key above)
- Symlink the skill(s) into your agent's skills directory (see Agent Integration below)
- On first run, the wrapper auto-builds from source if Go is available. Otherwise it prompts you to confirm downloading a pre-built binary from GitHub releases
Each tool's full usage is documented in its SKILL.md.
Each skill folder contains a SKILL.md that agents read to understand how to invoke the tool. Symlink or copy the skill folder into your agent's skills directory, then install the binary inside it.
Pi / Gemini CLI / Codex / other agents
Default skills directory: ~/.agents/skills/
# bash/zsh
for skill in kagi-*; do ln -s "$(pwd)/$skill" ~/.agents/skills/"$skill"; done
# fish
for skill in kagi-*; ln -s (pwd)/$skill ~/.agents/skills/$skill; endDefault skills directory: ~/.claude/skills/
# bash/zsh
for skill in kagi-*; do ln -s "$(pwd)/$skill" ~/.claude/skills/"$skill"; done
# fish
for skill in kagi-*; ln -s (pwd)/$skill ~/.claude/skills/$skill; endThe binaries speak plain text and JSON (--json flag). No special integration is needed beyond dropping the skill folder in the right place.