pi-provider-kimi-code 0.2.1 → 0.2.2
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 +13 -11
- package/index.ts +19 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
[](https://www.npmjs.com/package/pi-provider-kimi-code)
|
|
3
3
|
[](./LICENSE)
|
|
4
4
|
|
|
5
|
-
**Reuse your [Kimi Code
|
|
5
|
+
**Reuse your [Kimi Code Plan](https://www.kimi.com/code/docs/en/) inside [pi-coding-agent](https://pi.dev/)** — no separate API credits, no second billing dashboard. Every request draws from your Kimi Code membership quota (the 5-hour token bucket) instead of billing per-token on the Moonshot Open Platform.
|
|
6
6
|
|
|
7
|
-
It's **"Claude Code for Kimi"** — log in with your Kimi account, with `KIMI_API_KEY` still supported as a fallback for CI. You get Kimi K2.5, Kimi K2 Thinking Turbo, and the umbrella `kimi-code` model with a 262K-token context window, automatic prompt caching, automatic large-image and video upload, and compatibility with both Anthropic-style and OpenAI-style clients.
|
|
7
|
+
It's **"Claude Code for Kimi"** — log in with your Kimi account, with `KIMI_API_KEY` still supported as a fallback for CI. You get Kimi for Coding, **Kimi K2.6 Code Preview**, Kimi K2.5, Kimi K2 Thinking Turbo, and the umbrella `kimi-code` model with a 262K-token context window, automatic prompt caching, automatic large-image and video upload, and compatibility with both Anthropic-style and OpenAI-style clients.
|
|
8
8
|
|
|
9
9
|
## Who is this for?
|
|
10
10
|
|
|
11
|
-
- You already pay for a **[Kimi Code
|
|
11
|
+
- You already pay for a **[Kimi Code Plan](https://www.kimi.com/code/docs/en/)** and want to use it inside `pi-coding-agent` instead of the official `kimi-cli` — see [MoonshotAI/kimi-cli#757](https://github.com/MoonshotAI/kimi-cli/issues/757) for the canonical feature request this extension answers.
|
|
12
12
|
- You want **"Claude Code for Kimi"**: log in with your Kimi account instead of buying separate API credits. (`KIMI_API_KEY` is also supported as a fallback for CI.)
|
|
13
|
-
- You're in the [pi / pi-mono](https://github.com/badlogic/pi-mono) ecosystem and want **Kimi K2.
|
|
13
|
+
- You're in the [pi / pi-mono](https://github.com/badlogic/pi-mono) ecosystem and want **Kimi K2.6 Code Preview**, **Kimi K2.5**, or **Kimi K2 Thinking Turbo** as a pi provider.
|
|
14
14
|
|
|
15
15
|
Pay-per-token via `KIMI_API_KEY` also works if you just want to try Kimi in CI or without a subscription.
|
|
16
16
|
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
19
|
- **Browser login with your Kimi account** — reuse your Kimi Code Membership without buying separate API credits. Credentials are stored locally and refreshed automatically. `KIMI_API_KEY` is also accepted for pay-per-token or CI use.
|
|
20
|
-
- **262K-token context window** on all
|
|
20
|
+
- **262K-token context window** on all registered models.
|
|
21
21
|
- **Automatic prompt caching** — binds Kimi's prompt cache to your pi session so repeated calls hit the cache cheaply (observed TTL ~5-10 minutes). Honors pi's `PI_CACHE_RETENTION=none` if you want to disable caching entirely.
|
|
22
22
|
- **Automatic large-image and video upload** — images over 1 MB and all videos are uploaded to Kimi ahead of time, so you don't hit inline payload limits.
|
|
23
23
|
- **Works with both Anthropic- and OpenAI-compatible modes** — use whichever one your pi setup expects.
|
|
@@ -47,7 +47,7 @@ If you prefer not to use npm, download the tarball from the [latest release](htt
|
|
|
47
47
|
curl -L https://github.com/Leechael/pi-provider-kimi-code/releases/latest/download/pi-provider-kimi-code.tar.gz | tar -xz -C /tmp
|
|
48
48
|
|
|
49
49
|
# Install from the extracted directory
|
|
50
|
-
pi install /tmp/
|
|
50
|
+
pi install /tmp/pi-provider-kimi-code
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
## Authentication
|
|
@@ -72,11 +72,13 @@ KIMI_API_KEY=sk-... pi
|
|
|
72
72
|
|
|
73
73
|
## Models
|
|
74
74
|
|
|
75
|
-
| ID
|
|
76
|
-
|
|
|
77
|
-
| `kimi-
|
|
78
|
-
| `kimi-k2.
|
|
79
|
-
| `kimi-
|
|
75
|
+
| ID | Name | Reasoning | Input | Context | Max Output |
|
|
76
|
+
| -------------------------- | ---------------------- | --------- | ------------------ | ------- | ---------- |
|
|
77
|
+
| `kimi-for-coding` | Kimi for Coding | yes | text, image, video | 262 144 | 32 000 |
|
|
78
|
+
| `kimi-k2.6-code-preview` | Kimi K2.6 Code Preview | yes | text, image, video | 262 144 | 32 000 |
|
|
79
|
+
| `kimi-code` | Kimi Code (kimi-k2.5) | yes | text, image | 262 144 | 32 000 |
|
|
80
|
+
| `kimi-k2.5` | Kimi K2.5 | yes | text, image | 262 144 | 32 000 |
|
|
81
|
+
| `kimi-k2-thinking-turbo` | Kimi K2 Thinking Turbo | yes | text | 262 144 | 32 000 |
|
|
80
82
|
|
|
81
83
|
Select a model inside `pi`:
|
|
82
84
|
|
package/index.ts
CHANGED
|
@@ -806,9 +806,27 @@ export default function (pi: ExtensionAPI) {
|
|
|
806
806
|
headers: getCommonHeaders(),
|
|
807
807
|
|
|
808
808
|
models: [
|
|
809
|
+
{
|
|
810
|
+
id: "kimi-for-coding",
|
|
811
|
+
name: "Kimi for Coding",
|
|
812
|
+
reasoning: true,
|
|
813
|
+
input: ["text", "image", "video"],
|
|
814
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
815
|
+
contextWindow: 262144,
|
|
816
|
+
maxTokens: 32000,
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
id: "kimi-k2.6-code-preview",
|
|
820
|
+
name: "Kimi K2.6 Code Preview",
|
|
821
|
+
reasoning: true,
|
|
822
|
+
input: ["text", "image", "video"],
|
|
823
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
824
|
+
contextWindow: 262144,
|
|
825
|
+
maxTokens: 32000,
|
|
826
|
+
},
|
|
809
827
|
{
|
|
810
828
|
id: "kimi-code",
|
|
811
|
-
name: "Kimi Code (
|
|
829
|
+
name: "Kimi Code (kimi-k2.5)",
|
|
812
830
|
reasoning: true,
|
|
813
831
|
input: ["text", "image"],
|
|
814
832
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-provider-kimi-code",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Pi extension for Kimi Code — reuse your
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Pi extension for Kimi Code — reuse your Kimi Code Plan in pi-coding-agent (K2.6, K2.5)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
7
7
|
"pi-extension",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"kimi-for-coding",
|
|
19
19
|
"kimi-coder",
|
|
20
20
|
"kimi-k2",
|
|
21
|
+
"kimi-k2.6",
|
|
21
22
|
"kimi-k2.5",
|
|
22
23
|
"kimi-k2-thinking",
|
|
23
24
|
"moonshot",
|