provider

Moonshot Kimi

Direct answerDirect mainland China access uses https://api.moonshot.cn/v1 and a Moonshot API key. K3, K2.6, and K2.7 use different thinking and tool parameters, while this gateway uses its own token and enabled model name.

Updated · Reviewed

Mainland, international, and gateway access

The mainland direct base is https://api.moonshot.cn/v1 and uses a Moonshot API key. Mainland platform.kimi.com and international platform.kimi.ai isolate accounts, balances, and keys, so using the wrong site commonly returns 401. This gateway uses its own base URL and Bearer token and declares only /v1/chat/completions; provider balance, file, and token-estimation APIs are not gateway routes.

Model parameters are not interchangeable

Thinking controls differ by family: K3 uses reasoning_effort, K2.6 uses thinking, and K2.7 Code always thinks and cannot disable it. Tool-choice capabilities also differ; for example, tool_choice=required is not universal. Through this gateway, first select an enabled model and send only fields supported by that exact model.

Streaming and tool loops

Streamed tool-call arguments arrive incrementally by index and must be concatenated before JSON parsing. The application validates and executes functions and returns a role=tool message with the same tool_call_id. Preserve the full assistant message, including reasoning_content and tool_calls, across turns; new integrations should not use the deprecated function_call shape.

Errors, limits, and long requests

For 401, check the mainland/international site and key. For 429, inspect error.type to distinguish engine overload, balance, concurrency, RPM, TPM, or TPD. Retain request_id and queue, throttle, or stop retries according to the cause. Prefer streaming and explicit timeouts for long requests rather than discovering failure only at a server timeout.

Cost and quality safety

Tool definitions, context, and reasoning all consume tokens, and a large context does not guarantee retrieval quality. Cap output and concurrency, alert on usage, trim history, and add retrieval and citations for critical claims. Models, pricing, and tier limits change, so use live documentation rather than hard-coded values.

Reviewed provider catalog

Latest models by capability

These are provider-catalog models, not a promise of availability on this site. Confirm callable IDs, endpoints, and pricing in the model marketplace.

Text, reasoning, and code

Check live availability in the model marketplace

Use cases

  • Long context
  • Long-horizon coding tasks
  • Knowledge work and visual understanding

API protocols

  • /v1/chat/completions

FAQ

Why does Kimi return 401 even when the API key looks correct?

First verify the site: mainland China platform.kimi.com and international platform.kimi.ai isolate accounts, balances, and keys. The mainland direct base is https://api.moonshot.cn/v1; gateway calls require this site's token instead.

Can K3, K2.6, and K2.7 share the same thinking parameters?

No. K3 uses reasoning_effort, K2.6 uses thinking, and K2.7 Code always thinks and cannot disable it. Features such as tool_choice=required are also not universal, so build requests from the exact model page.

Why can a streamed Kimi tool_calls argument not be parsed as JSON immediately?

Streamed arguments arrive in fragments indexed by tool call and must be concatenated first. Every call needs a matching role=tool message, and later turns should preserve the complete assistant message, including reasoning_content and tool_calls.

Should I retry every Kimi 429 response?

No. A 429 can mean engine overload, insufficient balance or quota, organization concurrency, RPM, TPM, or TPD. Read error.type to decide whether to wait, reduce concurrency, add balance, or stop, and retain the request_id.

Official sources

  1. Kimi API Overview Official
  2. Kimi API Reference Overview Official
  3. Kimi Model Parameters Official
  4. Kimi Tool Calling Guide Official
  5. Kimi API Errors Official