kimiflare 0.63.0 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,9 +25,9 @@
25
25
  | Mode | How it works | Best for |
26
26
  |------|-------------|----------|
27
27
  | **BYOK** | Bring your own Cloudflare Account ID + API Token. Traffic goes straight to Workers AI from your account. | Power users who want full control and direct billing. |
28
- | **Kimiflare Cloud** | Device auth — no API key needed. We proxy requests through our managed endpoint. | Getting started quickly without a Cloudflare account. |
28
+ | ~~**Kimiflare Cloud**~~ | ~~Device auth — no API key needed. We proxy requests through our managed endpoint.~~ | ~~Getting started quickly without a Cloudflare account.~~ |
29
29
 
30
- > 🎁 **Try Kimiflare Cloud free** — sign up and get **5 million tokens** on us until May 14, 2026. Run `kimiflare --cloud` or pick "Cloud (managed)" during onboarding.
30
+ > ~~🎁 **Try Kimiflare Cloud free** — sign up and get **5 million tokens** on us until May 14, 2026. Run `kimiflare --cloud` or pick "Cloud (managed)" during onboarding.~~
31
31
 
32
32
  ## What to remember
33
33
 
@@ -66,7 +66,7 @@ npm install -g kimiflare
66
66
  kimiflare
67
67
  ```
68
68
 
69
- On first run, an interactive onboarding wizard asks how you want to connect — BYOK or Cloud. That's it.
69
+ On first run, an interactive onboarding wizard asks how you want to connect — BYOK ~~or Cloud~~. That's it.
70
70
 
71
71
  Or run without installing:
72
72
 
@@ -76,6 +76,27 @@ npx kimiflare
76
76
 
77
77
  Requires Node.js ≥ 20.
78
78
 
79
+ ### AI Gateway (default)
80
+
81
+ KimiFlare now routes Workers AI requests through your own **Cloudflare AI Gateway**. This unlocks:
82
+
83
+ - Per-request payload logs in the Cloudflare dashboard
84
+ - Response caching (set TTL with `/gateway cache-ttl <seconds>`)
85
+ - Authoritative cost via the Gateway logs API, replacing local cost heuristics
86
+ - Auto-tagging of every request with `feature` / `sessionId` / `turnIdx` metadata
87
+
88
+ The onboarding wizard creates or picks an AI Gateway for you. Your Cloudflare API token needs these permissions:
89
+
90
+ - `Workers AI:Read`
91
+ - `AI Gateway:Read` (to list gateways)
92
+ - `AI Gateway:Edit` (to create gateways)
93
+
94
+ Edit your token at: https://dash.cloudflare.com/profile/api-tokens
95
+
96
+ Once configured, run `/cost` in the TUI to see a Gateway section with cache hit ratio and direct dashboard links to each request log.
97
+
98
+ For emergencies, set `KIMIFLARE_DISABLE_AI_GATEWAY=1` to fall back to the direct Workers AI path.
99
+
79
100
  ### One-shot mode
80
101
 
81
102
  ```sh
@@ -148,7 +169,7 @@ const { session } = await createAgentSession({
148
169
  });
149
170
  ```
150
171
 
151
- **For zero-credential onboarding**, use KimiFlare Cloud mode. The user authenticates via GitHub device flow and a Cloudflare Worker proxies AI requests. Your app never sees raw Cloudflare credentials — only a GitHub token and `remoteWorkerUrl`.
172
+ ~~**For zero-credential onboarding**, use KimiFlare Cloud mode. The user authenticates via GitHub device flow and a Cloudflare Worker proxies AI requests. Your app never sees raw Cloudflare credentials — only a GitHub token and `remoteWorkerUrl`.~~
152
173
 
153
174
  #### RPC mode (subprocess)
154
175