pi-provider-kimi-code
v0.1.2
Published
pi custom provider extension for Kimi Code models with OAuth device-code login
Maintainers
Readme
pi-provider-kimi-code
A pi-coding-agent custom provider extension that adds Kimi Code models with OAuth device-code login.
Install
pi install npm:pi-provider-kimi-codeOr load without installing:
pi -e /path/to/pi-provider-kimi-codeAuthentication
OAuth (recommended)
Inside pi, run:
/login kimi-codingThis starts the device-code flow — a browser window opens, you authorize, and credentials are stored automatically.
API Key
Set the KIMI_API_KEY environment variable:
KIMI_API_KEY=sk-... piModels
| 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-thinkingHow It Works
- 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
Credits
This extension is based on the OAuth implementation from kimi-cli by Moonshot AI.
License
MIT
