Install
openclaw skills install kagi-fastgptAsk questions and get AI-synthesized answers backed by live web search, via Kagi's FastGPT API. Returns a direct answer with cited references. Use when you n...
openclaw skills install kagi-fastgptGet AI-generated answers with cited web sources using Kagi's FastGPT API. FastGPT runs a full web search under the hood and synthesizes results into a concise answer — ideal for factual questions, API lookups, and current-events queries.
This skill uses a Go binary for fast startup and no runtime dependencies. The binary can be downloaded pre-built or compiled from source.
Requires a Kagi account with API access enabled. Uses the same KAGI_API_KEY as the kagi-search skill.
~/.profile or ~/.zprofile):
export KAGI_API_KEY="your-api-key-here"
1.5¢ per query ($15 USD per 1000 queries). Cached responses are free.
{baseDir}/kagi-fastgpt.sh "query" # Ask a question (default)
{baseDir}/kagi-fastgpt.sh "query" --json # JSON output
{baseDir}/kagi-fastgpt.sh "query" --no-refs # Answer only, no references
{baseDir}/kagi-fastgpt.sh "query" --no-cache # Bypass response cache
{baseDir}/kagi-fastgpt.sh "query" --timeout 60 # Custom timeout (default: 30s)
| Flag | Description |
|---|---|
--json | Emit JSON output (see below) |
--no-refs | Suppress references in text output |
--no-cache | Bypass cached responses (use for time-sensitive queries) |
--timeout <sec> | HTTP timeout in seconds (default: 30) |
Prints the synthesized answer, followed by a numbered reference list:
Python 3.11 was released on October 24, 2022 and introduced several improvements...
--- References ---
[1] What's New In Python 3.11 — Python 3.11.3 documentation
https://docs.python.org/3/whatsnew/3.11.html
The headline changes in Python 3.11 include significant performance improvements...
[2] ...
Token usage and API balance are printed to stderr.
--json)Returns a JSON object with:
query — the original queryoutput — the synthesized answertokens — tokens consumedreferences[] — array of { title, url, snippet } objectsmeta — API metadata (id, node, ms)OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ARCH="amd64" ;;
aarch64|arm64) ARCH="arm64" ;;
esac
TAG=$(curl -fsSL "https://api.github.com/repos/joelazar/kagi-skills/releases/latest" | grep '"tag_name"' | cut -d'"' -f4)
BINARY="kagi-fastgpt_${TAG}_${OS}_${ARCH}"
mkdir -p {baseDir}/.bin
curl -fsSL "https://github.com/joelazar/kagi-skills/releases/download/${TAG}/${BINARY}" \
-o {baseDir}/.bin/kagi-fastgpt
chmod +x {baseDir}/.bin/kagi-fastgpt
# Verify checksum (recommended)
curl -fsSL "https://github.com/joelazar/kagi-skills/releases/download/${TAG}/checksums.txt" | \
grep "${BINARY}" | sha256sum --check
Pre-built binaries are available for Linux and macOS (amd64 + arm64) and Windows (amd64).
cd {baseDir} && go build -o .bin/kagi-fastgpt .
Alternatively, just run {baseDir}/kagi-fastgpt.sh directly — the wrapper auto-builds on first run if Go is available.
The binary has no external dependencies — only the Go standard library.