Skip to content

Kimi

Kimi uses the OpenAI-style chat completions endpoint at https://api.kimi.com/coding/v1/chat/completions.

Use a kimi.com account with Kimi Code access. Authentication is an RFC 8628 device-code flow:

Terminal window
claude-code-proxy kimi auth login
claude-code-proxy kimi auth status

The login prints a verification URL and user code, then polls until authorization completes. Access tokens have a short lifetime and are refreshed before expiry. A persistent device ID is created with the Kimi credential because it is bound into the issued token.

The upstream wire model is kimi-for-coding, displayed by Kimi tooling as Kimi K2.6. The proxy also accepts kimi-k2.6 and k2.6 as aliases. Use [1m] as a Claude Code compaction hint only when the actual upstream context and your chosen threshold support it.

Terminal window
ANTHROPIC_MODEL=kimi-for-coding[1m]
ANTHROPIC_SMALL_FAST_MODEL=kimi-for-coding[1m]

Claude Code’s /effort setting maps to Kimi reasoning_effort at low, medium, or high. Returned reasoning streams into Claude Code thinking blocks. If the Anthropic request disables thinking, the proxy omits both Kimi reasoning controls.

  • Claude function tools and tool choice map to Kimi chat-completions tools.
  • Tool calls and tool results round-trip through Anthropic content blocks.
  • Image input maps to Kimi image content.
  • Images inside tool results map to image_url parts in tool messages.
  • Supported video input maps to Kimi video content.

CCP_KIMI_BASE_URL, CCP_KIMI_OAUTH_HOST, and CCP_KIMI_USER_AGENT provide explicit endpoint and client overrides. CCP_USER_AGENT is the fallback user-agent override. These settings are intended for compatibility and controlled debugging. See Configuration for defaults and file keys.

Account access and rate limits come from Kimi. HTTP 429 is returned to Claude Code with retry-after. If login succeeds but requests return 401, inspect token expiry with kimi auth status, then log in again. Preserve the Kimi device ID alongside the credential when copying a configuration directory.

The proxy estimates count-tokens locally rather than asking Kimi. See Compatibility and limitations for shared boundaries.