Skip to main content

How Moonshot works

Moonshot AI publishes the Kimi family of models (K2, K2.5, K2.6, K2.6 Coding). Kimi is particularly strong on long-context code understanding and agentic workflows, and the API is fully OpenAI-compatible — Kodus can talk to it via the OpenAI-compatible provider. Kodus also has a dedicated Moonshot provider, which connects over Moonshot’s Anthropic-compatible endpoint (https://api.moonshot.ai/anthropic). Moonshot offers two paths to the same model family, each with its own endpoint:
  • Developer API (platform.moonshot.ai) — pay-per-token, billed per usage. Concurrency scales with your recharge tier.
  • Kimi Code Plan (kimi.com/code) — subscription with a dedicated coding endpoint. Flat pricing, capped concurrency (30 concurrent).
Moonshot’s consumer Kimi.com chat subscriptions (Andante, Moderato, etc.) are separate from both API paths. Chat subscriptions do not grant API access. Kimi Code Plan is the API-specific subscription.
Moonshot also operates a China-only platform (platform.moonshot.cn, base URL https://api.moonshot.cn/v1) billed in CNY. Use that only if you operate inside mainland China.

Plans at a glance

Kimi Code Plan (subscription)

Developer API (pay-per-token)

Developer API endpoint: https://api.moonshot.ai/v1 (international). Concurrency scales with recharge tier — Tier 1 ($10 recharge) starts at ~50 concurrent, up to ~1000 concurrent on Tier 5.

Creating an API Key

A Moonshot account is required to create an API key.
  1. Go to kimi.com/code and subscribe to the plan.
  2. Open the key management area for your subscription.
  3. Create a Kimi Code key and copy it.
Kimi Code keys only work against https://api.kimi.com/coding/v1. They will return 401 if sent to api.moonshot.ai.

Configure Moonshot in Kodus

The primary flow is the AI providers page on Kodus Cloud. Self-hosted users who prefer fixing the provider at the process level can use environment variables instead.
1

Open AI providers and pick Moonshot

In the sidebar, open AI providers (app.kodus.io/byok). On the Providers tab, click the Moonshot tile (under Connect your first provider, or Add another provider if you already connected one).
2

Paste your API key and pick the model

Paste your Developer API key from platform.moonshot.ai in the API key card. The Model picker then loads Moonshot’s models — pick one (e.g. kimi-k2.6) or choose Type model manually. Kodus fills in the https://api.moonshot.ai/anthropic endpoint for you; this tile has no plan selector and no base URL field, so for a Kimi Code Plan key (or the China platform) use Option 2 below.
3

Test & save

Click Test & save. Kodus tests the connection and saves the config on success. 401 means the key doesn’t match the endpoint.

Tuning reasoning (optional)

Thinking / Reasoning is under Advanced (optional). For Kimi, any level other than Off emits thinking: { type: "enabled" }. To override it, switch Thinking / Reasoning to Custom and paste one of these:
  • Disable thinking for faster/cheaper reviews on small PRs:
  • Force a specific token budget (if Moonshot adds support for budget_tokens on your tier):
No namespace wrapping needed — Kodus wraps the options under the active provider’s namespace before sending. See the main BYOK doc → Custom JSON override for details.

Tuning concurrency

  • Kimi Code Plan: set Max concurrent requests (under Advanced (optional)) to 30 (the documented cap). Going higher returns 429.
  • Developer API: start empty (no cap). Your actual limit scales with your recharge tier — Tier 1 (~10recharge)allows 50concurrent;Tier5( 10 recharge) allows ~50 concurrent; Tier 5 (~3000) allows ~1000. Lower it explicitly if you see 429s at review time.
On the Routing tab, set Kimi as Model for all tasks and an OpenAI or Anthropic model as Fallback (optional) — if Moonshot returns 429 or 402, Kodus fails over automatically.

Option 2 — OpenAI-compatible endpoint

For the Kimi Code Plan, the China platform, or Moonshot’s OpenAI-compatible endpoint, open AI providers, pick OpenAI-compatible under Custom on the Providers tab, and fill:

Option 3 — Self-hosted (environment variables)

If you run Kodus in Fixed Mode (single global provider, no per-org BYOK), configure Moonshot in the .env of your API + worker containers:
This path is only needed for self-hosted Kodus installs that deliberately disable BYOK. If BYOK is enabled on your self-hosted instance, prefer Option 1 or Option 2 — the AI providers page works the same as on Cloud.
Restart the API and worker containers after editing .env, then verify the integration:
For the full self-hosted setup (domains, security keys, database, webhooks, reverse proxy), follow the generic VM deployment guide and only swap the LLM block for the one above.

Choosing between Kimi Code Plan, Developer API, and aggregators

  • Kimi Code Plan — predictable flat-rate cost, 30-concurrent cap, dedicated api.kimi.com/coding/v1 endpoint optimized for coding workflows. Best for steady-state teams with predictable PR volume.
  • Moonshot Developer API — pay-per-token, concurrency scales with recharge tier, largest flexibility. Best for bursty workloads.
  • OpenRouter proxy — if you want one billing relationship across many providers, OpenRouter exposes Kimi models with a small routing markup. Pick this when Kimi is part of a mixed-provider fleet, not a primary workload.

Troubleshooting

  • Kimi Code Plan keys only work against api.kimi.com/coding/v1.
  • Developer API keys from platform.moonshot.ai only work against api.moonshot.ai/v1.
  • Developer API keys from platform.moonshot.cn only work against api.moonshot.cn/v1.
  • The Moonshot tile always uses https://api.moonshot.ai/anthropic, so it needs a platform.moonshot.ai key. Connect Kimi Code Plan or platform.moonshot.cn keys through OpenAI-compatible with the matching Base URL.
  • Developer API bills pay-per-token. If balance runs out, requests return HTTP 402.
  • Add funds in the billing section of the console or set a monthly cap to avoid surprises.
  • Kimi Code Plan has flat pricing but is bound by its 30-concurrent cap and quota windows — 429 means you’ve hit one.
  • Confirm the model name matches the catalog (kimi-k2.6, kimi-k2.6, kimi-k2.5, kimi-k2-0905, kimi-k2).
  • Check platform.kimi.ai/docs for the current list — new versions ship regularly.
  • First call after idle periods may cold-start on Moonshot’s side.
  • If latency matters, kimi-k2-0905 is generally faster than the K2.6 variants for routine reviews.
  • Users outside China should always use api.moonshot.ai or api.kimi.com. api.moonshot.cn may be unreachable or rate-limited from outside mainland China.
  • Confirm outbound HTTPS to the chosen endpoint is allowed from your Kodus deployment.