A pi-coding-agent custom provider extension that adds Kimi Code models with OAuth device-code login.
pi install npm:pi-provider-kimi-codeOr load without installing:
pi -e /path/to/pi-provider-kimi-codeInside pi, run:
/login kimi-coding
This starts the device-code flow — a browser window opens, you authorize, and credentials are stored automatically.
Set the KIMI_API_KEY environment variable:
KIMI_API_KEY=sk-... pi| ID | Name | Reasoning | Input | Context | Max Output |
|---|---|---|---|---|---|
kimi-k2-thinking |
Kimi K2 Thinking | yes | text | 262 144 | 32 768 |
k2p5 |
Kimi K2.5 | yes | text, image | 262 144 | 32 768 |
Select a model inside pi:
/model kimi-coding/kimi-k2-thinking
- Registers provider
kimi-codingwith base URLhttps://api.kimi.com/coding - Uses
api: "anthropic-messages"— Kimi's API is wire-compatible with the Anthropic Messages format, so no custom streaming logic is needed - OAuth uses RFC 8628 device authorization grant against
https://auth.kimi.com - Zero dependencies — types from
@mariozechner/pi-aiand@mariozechner/pi-coding-agentare provided by the pi runtime - Zero build step — pi loads TypeScript directly via jiti
This extension is based on the OAuth implementation from kimi-cli by Moonshot AI.
MIT