Providers
Moonshot AI / Kimi API
A vendor-independent multi-provider AI agent orchestrator: dispatch one task to many agents, judge the results, ship the winner.
- Kind: raw API, OpenAI-compatible Chat Completions
- Official docs: https://platform.kimi.ai/docs (intl, redirected from platform.moonshot.ai) · https://platform.moonshot.cn/docs (mainland)
- Cyberine adapter:
LoopAgentAdapter (build worker loop-kimi-build); also reachable via OpenCode (opencode-kimi).
- Researched/verified: 2026-06-07 — confidence high. Bumped default to
kimi-k2.7-code 2026-07-01 (T517) — re-confirmed live against platform.kimi.ai/docs/models, .../pricing/chat-k27-code, .../guide/kimi-k2-7-code-quickstart, and models.dev/providers/moonshotai (also carries the OpenCode moonshotai/kimi-k2.7-code slug); release corroborated by MarkTechPost and Cloudflare Workers AI changelog, both dated 2026-06-12.
Base URL & auth
| |
|---|
| Base URL (intl) | https://api.moonshot.ai/v1 |
| Base URL (mainland) | https://api.moonshot.cn/v1 |
| Auth header | Authorization: Bearer <MOONSHOT_API_KEY> |
| Keys | https://platform.kimi.ai |
Endpoints
| Method + path | Purpose |
|---|
POST /chat/completions | Chat completions (OpenAI-compatible) + Kimi thinking body param. |
GET /models | List model ids. |
POST /files | File upload (temporarily free). |
Models
| Model id | Notes |
|---|
kimi-k2.7-code | Cyberine default (MOONSHOT_MODEL), since 2026-07-01. "Kimi's most capable coding model to date" — 1T MoE (32B active), 262,144 ctx, +21.8% on Kimi Code Bench v2 vs k2.6, ~30% lower reasoning-token usage. Thinking is mandatory — cannot be disabled ({"thinking":{"type":"disabled"}} errors). Vision + agentic tool-calling carried over from k2.6. Released 2026-06-12. |
kimi-k2.7-code-highspeed | Same model, speed-optimized serving tier: ~180 tok/s (up to ~260 tok/s short-context). Same 262,144 ctx, thinking still mandatory. Priced ~2x the standard tier. |
kimi-k2.6 | Previous flagship. 256K ctx, multimodal (text+vision+video). Thinking ON by default but can be disabled ({"thinking":{"type":"disabled"}}). temp fixed 1.0 (thinking) / 0.6 (non). |
kimi-k2.5 | 256K ctx, text+vision, same param behavior. |
moonshot-v1-{8k,32k,128k} | Legacy text models, no vision/thinking. (+ -vision-preview variants.) |
kimi-k2-{0905,0711}-preview, kimi-k2-turbo-preview, kimi-k2-thinking{,-turbo} | DISCONTINUED 2026-05-25 → migrate to kimi-k2.6 or kimi-k2.7-code. |
Key request params
model, messages (role/content/tool_calls/reasoning_content)
thinking: {"type":"enabled"} (default for k2.6, and the ONLY accepted value for k2.7-code — {"type":"disabled"} errors on k2.7-code) — pass via SDK extra_body
thinking.keep: omit/null (ignore history, cheaper) or "all" (preserve, billed for re-sent tokens)
tool_choice: when thinking is enabled, only auto or none accepted
max_tokens: set ≥16,000 when thinking is on (reasoning counts against it)
temperature: fixed 1.0 in thinking mode; top_p ~0.95; stream recommended true
Notable features
- OpenAI-compatible drop-in.
- Thinking mode with
reasoning_content alongside content; in stream, reasoning_content always precedes content.
- Multi-step agentic tool calling (200–300 sequential calls in one reasoning chain).
- Vision + video (request body ≤100MB), automatic context caching (two-tier pricing).
- Built-in web-search tool — incompatible with thinking mode.
Gotchas
- CRITICAL —
reasoning_content echo REQUIRED: when thinking is on and the model issues a tool_call, the assistant message carries reasoning_content; the next request (with the tool result) MUST include that assistant message with reasoning_content intact, or you get HTTP 400 "thinking is enabled but reasoning_content is missing". This is exactly why LoopAgentAdapter replays reasoning_content on the assistant turn. (Opposite of DeepSeek — see deepseek.md.)
tool_choice restricted to auto/none under thinking; required/named errors.
- Web-search tool cannot combine with thinking.
- Reasoning tokens count against
max_tokens → truncation if too low.
temperature fixed 1.0 in thinking mode — don't override.
- k2.6 thinking is ON by default and can be turned off (
{"thinking":{"type":"disabled"}}); k2.7-code has NO non-thinking mode — the same disable call throws an error, so anything that assumes it can toggle thinking off for the Moonshot worker will break on k2.7-code (the DeepSeek-style thinking:{type:disabled} override in LoopAgentAdapter is gated to DeepSeek-direct only — see deepSeekDirect — and is never sent for Moonshot, so this is not currently a live bug).
- The listed discontinued
kimi-k2-*-preview ids now 404.
platform.moonshot.ai docs redirect to platform.kimi.ai; the API host api.moonshot.ai/v1 still works.
Pricing
kimi-k2.6: Input $0.95/1M (cache miss) · $0.16/1M (cache hit). Output $4.00/1M. 262K ctx single tier. Page: https://platform.kimi.ai/docs/pricing/chat-k26
kimi-k2.7-code: Input $0.95/1M (cache miss) · $0.19/1M (cache hit). Output $4.00/1M. kimi-k2.7-code-highspeed: roughly 2x ($1.90/1M input miss, $8.00/1M output) for the higher-throughput serving tier. 262,144 ctx single tier. Thinking tokens billed as output (unavoidable — thinking cannot be disabled on k2.7-code). Page: https://platform.kimi.ai/docs/pricing/chat-k27-code
Cyberine integration notes
loop-kimi-build registered when MOONSHOT_API_KEY is set; MOONSHOT_BASE_URL / MOONSHOT_MODEL configure it. Default model bumped kimi-k2.6 -> kimi-k2.7-code 2026-07-01 (T517). RETIRED 2026-08-27 (RETIRED_WORKERS in workerProfiles.ts) — see the account-status note below; the profile stays registered (reversible) but the router will not rank it.
opencode-kimi worker uses OpenCode model moonshotai/kimi-k2.7-code (CYBERINE_OPENCODE_KIMI_MODEL) — confirmed present in the models.dev registry under that exact slug. Also RETIRED 2026-08-27, same underlying account.
- The Kimi echo contract is the canonical reason
LoopAgentAdapter buffers + replays reasoning_content. Note the conflict this creates for DeepSeek (see deepseek.md integration note). This contract is unchanged on k2.7-code (thinking is still mandatory there, so the replay requirement if anything applies more strictly).
- Moonshot account status (T651c, 2026-08-27, live-probed independently of the 2026-08-22 measurement that drove the retirement above): a 1-token
POST /v1/chat/completions against kimi-k3 with the real MOONSHOT_API_KEY from this repo's .env returned HTTP 429 exceeded_current_quota_error — "Your account org-... is suspended due to insufficient balance, please recharge your account or check your plan and billing details". The key itself authenticates (this is a billing-tier error, not an auth error) — the account is suspended, not the credential invalid. Re-probe before assuming this is still true; recharging the account is the only way to un-suspend it.
- Selectable LLM-judge backend (T651c).
src/orchestrator/buildJudges.ts previously hardcoded judge construction to DeepSeek-direct-first / OpenRouter-fallback with no Moonshot path. Wired CYBERINE_JUDGE_BACKEND=moonshot (+ CYBERINE_MOONSHOT_JUDGE_MODEL, default kimi-k3) as an opt-in alternative for LlmJudge/AdversarialJudge/ClaimVerifier/the synthesizer, reusing the same makeOpenAICompletion single-turn completion path the DeepSeek/OpenRouter judges use (no tool-calling loop, so the reasoning_content replay contract above does not apply here — makeOpenAICompletion already falls back to reasoning_content when content is empty, which covers Kimi's always-on thinking). Assessed worth adding: kimi-k3 is near-frontier general reasoning at Sonnet-tier price, a credible second opinion distinct from the default panel. NOT made the default (the account-suspended finding above means this path is code-only, unverified against a live verdict — see USAGE.md's "Selectable judge backend" recipe). See docs/providers/README.md's env-var table for the two new vars.
Sources