You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,20 @@ Before `1.0.0`, breaking changes may still ship in minor releases.
7
7
8
8
## [Unreleased]
9
9
10
+
### Added
11
+
12
+
- Added `KAGI_API_KEY`, `[auth].api_key`, and `kagi auth set --api-key` for current `/api/v1` Search and Extract API credentials.
13
+
14
+
### Changed
15
+
16
+
- Breaking: split current API keys from legacy API tokens. `KAGI_API_TOKEN` and `[auth].api_token` now represent legacy `/api/v0` credentials only, while base Search API mode requires `KAGI_API_KEY` or `[auth].api_key`.
17
+
10
18
## [0.6.2]
11
19
12
20
### Added
13
21
14
22
- Added `kagi_extract` to the built-in MCP server tool list, matching the existing paid Extract API command behavior.
23
+
-`kagi extract` and MCP `kagi_extract` now reject session-only Extract on Kagi accounts whose API portal disallows Extract API access, avoiding legacy token regeneration loops.
Copy file name to clipboardExpand all lines: README.md
+19-14Lines changed: 19 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@
18
18
19
19
`kagi` is a terminal CLI for Kagi that gives you command-line access to search, quick answers, ask-page, assistant, translate, summarization, public feeds through `news` and `smallweb`, paid API commands like `fastgpt` and `enrich`, and account-level settings like lenses, custom assistants, custom bangs, and redirect rules. it is built for people who want one command surface for interactive use, shell workflows, and structured JSON output.
20
20
21
-
the main setup path is `kagi auth`. on a real terminal it opens a guided setup flow where you choose `Session Link`or `API Token`, get the official instructions inline, paste the credential, save it to `./.kagi.toml`, and validate it immediately. if you also use Kagi's paid API, the same wizard can add that too.
21
+
the main setup path is `kagi auth`. on a real terminal it opens a guided setup flow where you choose `Session Link`, `API Key`, or `Legacy API Token`, get the official instructions inline, paste the credential, save it to `./.kagi.toml`, and validate it immediately. if you also use Kagi's paid API, the same wizard can add that too.
|`KAGI_API_TOKEN`| public `summarize`, `extract`, `fastgpt`, `enrich web`, `enrich news`|
125
+
|`KAGI_SESSION_TOKEN`| base search fallback, `search --lens`, filtered search, `quick`, `ask-page`, `assistant`, `translate`, `summarize --subscriber`, and Extract eligibility checks through the authenticated API portal |
126
+
|`KAGI_API_KEY`| current `/api/v1` Search API and Extract API with `Bearer` auth |
127
+
|`KAGI_API_TOKEN`| legacy `/api/v0` public `summarize`, `fastgpt`, `enrich web`, and `enrich news` with `Bot` auth |
@@ -165,7 +170,7 @@ for the full command-to-token matrix, use the [`auth-matrix`](https://kagi.micr.
165
170
|`kagi batch`| run multiple searches in parallel with JSON, TOON, compact, pretty, markdown, or csv output and shared filters |
166
171
|`kagi auth`| launch the auth wizard, or inspect, validate, and save credentials |
167
172
|`kagi summarize`| use the paid public summarizer API or the subscriber summarizer with `--subscriber`|
168
-
|`kagi extract`| extract a page's full content as markdown through the paid API |
173
+
|`kagi extract`| extract a page's full content as markdown through the current paid API, using `KAGI_API_KEY` directly; session-only auth is rejected when Kagi's API portal does not allow Extract access|
169
174
|`kagi watch`| rerun a search on an interval and emit added/removed result URLs |
170
175
|`kagi notify`| send search or news output to a webhook |
171
176
|`kagi history`| inspect local command history and aggregate query stats |
Environment variables override `./.kagi.toml`. When both tokens are present, base `kagi search` defaults to session token; set `[auth] preferred_auth = "api"` in config to prefer API.
80
+
Environment variables override `./.kagi.toml`. When a session token and API key are both present, base `kagi search` defaults to the session token; set `[auth] preferred_auth = "api"` in config to prefer the API key.
Copy file name to clipboardExpand all lines: docs/commands/auth.mdx
+32-12Lines changed: 32 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: "Reference for the kagi auth wizard and non-interactive credential
5
5
6
6
# `kagi auth`
7
7
8
-
`kagi auth` is the main onboarding path for this CLI. On a real terminal, it launches an interactive setup wizard that lets you choose `Session Link`or `API Token`, shows the official Kagi settings page for that credential, accepts a paste, saves into `./.kagi.toml`, and validates the selected credential immediately.
8
+
`kagi auth` is the main onboarding path for this CLI. On a real terminal, it launches an interactive setup wizard that lets you choose `Session Link`, `API Key`, or `Legacy API Token`, shows the official Kagi settings page for that credential, accepts a paste, saves into `./.kagi.toml`, and validates the selected credential immediately.
9
9
10
10

11
11
@@ -29,7 +29,7 @@ kagi auth
29
29
The wizard flow is:
30
30
31
31
1. shows your current auth state and config path
32
-
2. lets you choose `Session Link`or `API Token`
32
+
2. lets you choose `Session Link`, `API Key`, or `Legacy API Token`
33
33
3. shows the official place to get that credential
34
34
4. accepts the pasted value
35
35
5. asks before overwriting an existing config value of the same type
Copy file name to clipboardExpand all lines: docs/commands/mcp.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ kagi mcp
17
17
18
18
-`kagi_search` - search Kagi
19
19
-`kagi_summarize` - summarize a URL or text through the public API
20
-
-`kagi_extract` - extract a page's full content as markdown through the paid Extract API. Accepts `url`.
20
+
-`kagi_extract` - extract a page's full content as markdown through the current `/api/v1`Extract API. Uses `KAGI_API_KEY` directly and rejects session-only auth when Kagi's API portal does not allow Extract access. Accepts `url`.
21
21
-`kagi_quick` - get a Kagi Quick Answer
22
22
-`kagi_news` - fetch Kagi News stories (no auth required). Accepts `category` (default `world`), `limit` (default `12`), and `lang` (default `default`).
23
23
-`kagi_news_search` - search the News tab of kagi.com and return story clusters (session token required). Accepts `query`, optional `region`, `freshness` (`day`/`week`/`month`), `order` (`default`/`recency`/`website`), and `limit`.
0 commit comments