← Back to PRs

#6960: feat: Add kimi-coding provider support

by YYW0228 open 2026-02-02 07:22 View on GitHub →
app: web-ui agents
## 🎯 Summary This PR adds support for the **kimi-coding** provider, enabling direct API access to Kimi Code K2.5 model for users in China region. ## 🐛 Problems Fixed 1. **Missing Provider**: provider was completely missing from the codebase 2. **Incorrect Base URL**: Initial attempt used non-existent `https://api.kimi.com/v1` (404) 3. **Wrong Model ID**: Used `k2p5` which doesn't exist 4. **API Key Reference**: Fixed environment variable reference format ## ✅ Changes ### Code Changes - Added `buildKimiCodingProvider()` function in `src/agents/models-config.providers.ts` - Added `KIMI_CODING_*` constants for API configuration - Integrated `kimi-coding` provider in `resolveImplicitProviders()` - Updated UI data file `ui/src/ui/data/moonshot-kimi-k2.ts` with `KIMI_CODING_MODELS` ### Configuration - **Base URL**: `https://api.moonshot.cn/v1` (China region endpoint) - **Model ID**: `kimi-k2.5` (correct model identifier) - **API Key**: Supports `KIMI_API_KEY` environment variable - **Context Window**: 256,000 tokens - **Max Tokens**: 8,192 tokens ## 🧪 Testing - ✅ Lint checks passed - ✅ Build successful - ✅ Model appears in `openclaw models list` with `Auth: yes` - ✅ API endpoint verified (China region) - ⚠️ Live API test showed server overload (temporary Moonshot API issue, not configuration problem) ## 📝 Usage ```bash # Set API key openclaw config set env.KIMI_API_KEY "your-api-key" # List models openclaw models list --all | grep kimi-coding # Use the model openclaw message send --model kimi-coding/kimi-k2.5 --message "Hello" --target telegram ``` ## 🔗 Related - Complements existing Moonshot provider - Enables multi-model collaboration with other Kimi variants - Follows the same pattern as other API providers in the codebase Closes #(issue-number-if-any) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a new implicit `kimi-coding` provider alongside existing Moonshot support by wiring it into `resolveImplicitProviders()` and defining a new provider config (base URL `https://api.moonshot.cn/v1`, OpenAI-compatible API) plus UI model catalog entries. Most of the change follows existing provider patterns (hardcoded baseUrl + a default model list). The key risk is correctness of how auth is plumbed and whether the model id aligns with the rest of the codebase/docs/onboarding flows for Kimi Coding. <h3>Confidence Score: 2/5</h3> - Not safe to merge as-is due to a likely env API key resolution bug and inconsistent Kimi Coding model IDs. - `resolveImplicitProviders()` currently uses the env var *name* (e.g. `KIMI_API_KEY`) as the `apiKey` value, which will break authentication when the provider is sourced from env. Additionally, the PR changes Kimi Coding’s model id to `kimi-k2.5` while other parts of the repo still reference `k2p5`, which risks broken onboarding/defaults and model selection. - src/agents/models-config.providers.ts (auth resolution + provider defaults); also audit `src/commands/onboard-auth.models.ts` and docs that still reference `kimi-coding/k2p5`. <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs