Moonshot AI / Kimi — Specialty LLM Tier
One provider, two product names: Moonshot AI is the company; Kimi is the consumer product and model family. In OpenClaw the two names are used interchangeably. The active integration is the Kimi K2 API (OpenAI-compatible endpoint at https://api.moonshot.ai/v1) accessed via portkey virtual key moonshot-kimi-84f4a1. This is a Tier 2 specialty path used for reasoning-heavy or coding-adjacent workloads — not the primary LLM tier. A SOURCE MISSING flag applies: the KB at knowledge-base/moonshot/ contains only a vendor audit file (_audit/2026-05-02.md), not a formal API.md. All documentation in this hub is sourced from that audit file + proxy.js code inspection.
⚠️ SOURCE MISSING
knowledge-base/moonshot/ contains only _audit/2026-05-02.md — no API.md, no WEBHOOKS.md, no CREDENTIALS.md. All content in this hub is derived from:
workspace/knowledge-base/moonshot/_audit/2026-05-02.md(vendor audit, 39 findings, 2026-05-02)/home/opsadmin/.openclaw/portkey-proxy/proxy.js— Fix #1 implementation (lines 344-360)workspace/_hubs/integrations/portkey.md— VKmoonshot-kimi-84f4a1entry
G-KB-SYNC-WITH-CLAUDEMD note: moonshot is in CLAUDE.md “Platforms with KB docs” list, but only has an _audit subdirectory, not a full API.md. Recommend creating knowledge-base/moonshot/API.md from vendor docs at https://platform.kimi.ai/docs/guide/start-using-kimi-api and https://github.com/moonshotai/Kimi-K2.
Quick reference
| Field | Value |
|---|---|
| Vendor | Moonshot AI (product: Kimi) |
| URL | https://platform.moonshot.ai / https://platform.kimi.ai |
| KB doc | [[sources/kb/moonshot/_audit/2026-05-02]] (audit only — SOURCE MISSING for API.md) |
| Auth method | Bearer (API key) |
| Auth credential | op://Aurora/moonshot/api_key |
| Cred-proxy port | n/a (pending B1-B6 ratification per nemoclaw-audit-2026-05-03) |
| Webhook port | n/a |
| Webhook handler | n/a |
| Webhook dedup table | n/a |
| Tunnel path | n/a |
| Outbound API base | https://api.moonshot.ai/v1 (OpenAI-compatible) |
| Anthropic-compat base | https://api.moonshot.ai/anthropic (Anthropic-format; NOT used in production) |
| Rate limits | RPM scales with cumulative recharge tier (default: low; paid: hundreds/min) |
| Rate-limit action | 429 → exponential backoff (3 retries), Discord ops alert; 429 may mask balance exhaustion |
| Cost | kimi-k2-turbo: up to 50% lower input pricing; kimi-k2-thinking-turbo: same reduced rates |
| Backup/recovery | Vendor-owned; fall through to OpenRouter via Portkey tier config on failure |
| Discord alert channel | ops |
| Drift cadence | manual |
| Status | production |
| Primary models | kimi-k2.6, kimi-k2-turbo, kimi-k2-thinking, kimi-k2-thinking-turbo |
| Portkey virtual key | moonshot-kimi-84f4a1 |
Fix #1: Kimi 404 → per-model gating in proxy.js
This is the most important implementation detail for this integration. Without this fix, Kimi (or any non-Claude model) requested by a max-plan agent caused a 404 on the :18903 LOCAL-SHORTCUT path, because that upstream binary (anthropic-max-router) only handles Anthropic /v1/messages requests.
Root cause
Max-plan agents (served via :18903) have their traffic routed to the LOCAL-SHORTCUT path by default. The :18903 anthropic-max-router does not serve non-Anthropic models — it returns 404 on anything that isn’t a Claude model request.
Fix implementation
proxy.js lines 344-360 gate the LOCAL-SHORTCUT path on isAnthropicModel:
// Step 2: Determine tier now that model is known.
// Max-plan agent routing is gated by isAnthropicModel — non-Claude models on max-plan
// agents (e.g., dispo asking for kimi-for-coding) fall through to Portkey cloud path.
// Without this gate, ALL of the agent's traffic would hit the Anthropic-only LOCAL-SHORTCUT
// and 404 on non-Claude models.
const isAnthropicModel = !!(model && model.toLowerCase().startsWith('claude'));
let portKeyConfig, tier;
const isMaxPlanAgent = !!(agentId && AGENT_CONFIGS[agentId] && isAnthropicModel);
if (isMaxPlanAgent) {
const agentCfg = AGENT_CONFIGS[agentId];
portKeyConfig = agentCfg.config;
tier = agentCfg.tier;
} else {
const tierInfo = MODEL_CONFIGS[model] || { config: DEFAULT_CONFIG, tier: 'default' };
portKeyConfig = tierInfo.config;
tier = tierInfo.tier;
}Effect: When a max-plan agent requests kimi-k2.6 (or any non-claude- model):
isAnthropicModel = falseisMaxPlanAgent = false(gated)- Falls through to
MODEL_CONFIGS[model]→moonshot-kimi-84f4a1virtual key → Portkey cloud → Moonshot API - No 404. Tool_calls row written via CHOKEPOINT-1.
Fix location: /home/opsadmin/.openclaw/portkey-proxy/proxy.js, lines ~344–360.
Fix authored: 2026-05-01 (per portkey hub notes as “Fix #1”).
Also documented in: portkey and anthropic.
Kimi K2 model family
| Model | Best for | Notes (from audit) |
|---|---|---|
kimi-k2.6 | General-purpose Kimi | OpenAI SDK compatible; base_url=https://api.moonshot.ai/v1 |
kimi-k2-turbo | High-speed, input-heavy | 50% lower input pricing; ~100 tokens/second throughput |
kimi-k2-thinking | Complex multi-step reasoning | Tool use, function calling, agentic tasks |
kimi-k2-thinking-turbo | Reasoning + speed | Same reduced pricing as turbo; speed + reasoning combined |
kimi-k2-0905-preview | Preview / testing | Earlier preview; not for production |
Key capability from audit: Kimi K2 is a 1T parameter MoE model with 32B activated parameters, specifically designed for tool use, reasoning, and autonomous problem-solving. Strong on tau2-telecom and AceBench benchmarks — well-suited for multi-step RE workflow orchestration.
Temperature note: Kimi-K2-Instruct recommended temperature = 0.6. If using Anthropic-compatible endpoint, Moonshot applies implicit mapping real_temperature = request_temperature * 0.6 — do not rely on this; use OpenAI-compatible endpoint with direct temperature=0.6.
Components
/home/opsadmin/.openclaw/portkey-proxy/proxy.js— Fix #1 implementation (lines 344–360);isAnthropicModelgate;moonshot-kimi-84f4a1VK assignment viaMODEL_CONFIGSworkspace/knowledge-base/moonshot/_audit/2026-05-02.md— vendor audit (39 findings); SOURCE MISSING for formal API reference- Portkey virtual key
moonshot-kimi-84f4a1— resolves toop://Aurora/moonshot/api_keyin Portkey dashboard - Platform dashboard: https://platform.moonshot.ai — API key management, usage, billing recharge tiers
How it’s used
- Trigger condition: Agent requests a model starting with
kimi-(e.g.,kimi-k2.6,kimi-k2-turbo) ormoonshot/prefixed model; or a Portkey tier config specifies Moonshot for reasoning tasks - Workflow:
proxy.js→isAnthropicModel = false(kimi does not start with ‘claude’) →MODEL_CONFIGS["kimi-k2.6"]→ Portkey VKmoonshot-kimi-84f4a1→https://api.moonshot.ai/v1/chat/completions→ Kimi response - Agents involved: dispo (kimi-for-coding pattern noted in portkey hub); any agent needing agentic/reasoning tasks that benefit from K2’s tool-call strength
- Failure mode: 404 (prevented by Fix #1); 429 rate limit (RPM tied to billing tier — may need recharge); balance exhaustion returns 429 (indistinguishable from rate limit)
- Success criteria: Non-404 response;
tool_callsrow written to Supabase; latency appropriate for model variant (turbo = faster)
Cross-links
Agents that touch this
- _summary — “kimi-for-coding” model request pattern documented in portkey hub
- _summary — may route reasoning-heavy sub-tasks to Kimi K2
- _summary — complex multi-step research; K2 agentic tool-calling is relevant
Skills that invoke this
- acq-analyze — complex analysis tasks may benefit from K2 reasoning
- hubspot-deal-ingest — multi-hop data enrichment; K2 tool-calling could orchestrate
Plans that govern this
- openclaw-self-improvement-layer-2026-05-03 — OSIL model tier evaluation; Kimi K2 is Tier 2 candidate for agentic tasks
- vendor-deep-audit-comprehensive-2026-05-02 — Moonshot/Kimi in Tier 1 vendor deep-audit candidates
- nemoclaw-audit-2026-05-03 — B1-B6 ratification; cred-proxy eligibility for Moonshot endpoint
- openclaw-fragmentation-fix-2026-05-01 — G-NO-PLAINTEXT-CREDS; key must be
op://Aurora/moonshot/api_key
Feedback rules
- feedback_no_plaintext_creds —
op://Aurora/moonshot/api_keyonly; never inline - feedback_chokepoint_principle — G-CHOKEPOINT-1; all Kimi calls must write
tool_callsrow - feedback_live_over_memory — SOURCE MISSING: verify actual Moonshot API behavior from live docs, not audit inference
- feedback_verify_schema_before_designing — check actual Kimi response shape before writing parsing code; audit is low-confidence
- feedback_audit_before_architect — run a live Kimi test call before building Moonshot-dependent features
- feedback_dual_write_required — G-DUAL-WRITE; Moonshot responses must reach both Portkey observability and Supabase
KB / source docs
[[sources/kb/moonshot/_audit/2026-05-02]]— 39-finding vendor audit (confidence: low throughout; NEEDS VERIFICATION for production use)- SOURCE MISSING: No
knowledge-base/moonshot/API.md— recommended remediation: create from https://platform.kimi.ai/docs/guide/start-using-kimi-api
System maps
- request-lifecycle — non-Anthropic model path; same flow as OpenRouter but terminates at Moonshot
- ports-topology — Portkey :18900 as single routing surface
Related: LLM provider tier cluster
Anchor: portkey
| Member | Role |
|---|---|
| portkey | Anchor; CHOKEPOINT-1; Fix #1 lives in proxy.js; VK moonshot-kimi-84f4a1 |
| anthropic | Primary tier (Tier 1); Moonshot is Tier 2 specialty alternative |
| openrouter | Tier 2 aggregator; broader model selection; different VK (openrouter-fallback) |
| moonshot-kimi | This hub — Tier 2 specialty; Kimi K2 MoE; tool-use + reasoning |
| voyage | Embedding tier; separate from LLM routing; Memory/embeddings cluster anchor: supabase |
Open issues / TODOs
- SOURCE MISSING: Create
knowledge-base/moonshot/API.mdfrom https://platform.kimi.ai/docs/guide/start-using-kimi-api and https://github.com/moonshotai/Kimi-K2 cred-proxy-eligible: pending— resolve after B1-B6 ratification per nemoclaw-audit-2026-05-03- Verify which
MODEL_CONFIGSkeys inproxy.jsmap tomoonshot-kimi-84f4a1— may needkimi-k2.6,kimi-k2-turbo,kimi-k2-thinkingall registered - Billing tier: Moonshot RPM scales with cumulative recharge — verify current tier before enabling high-volume routing
- Anthropic-compatible endpoint (
https://api.moonshot.ai/anthropic) is NOT wired and NOT tested — do not use without explicit testing - Temperature behavior: audit notes implicit
temperature * 0.6mapping on Anthropic-compat path — OpenAI-compat path should use directtemperature=0.6per Kimi docs
Recent activity
- 2026-05-03: hub created (W2-S7); SOURCE MISSING flagged; Fix #1 documented
- 2026-05-01: Fix #1 (Kimi 404 → per-model gating) shipped in proxy.js
- 2026-05-02: Vendor audit
knowledge-base/moonshot/_audit/2026-05-02.mdgenerated (39 findings)