Connecting Kimi Code to OpenClaw: Key Configuration Cheat Sheet

Kimi Code provides an API based on the Anthropic protocol. This post records the key configuration fields and gotchas for connecting it to OpenClaw.

Kimi Code is the Coding Plan subscription from Moonshot AI that provides an API based on the Anthropic protocol. If you’ve already subscribed to Kimi Code, here’s how to connect it to OpenClaw.

Core information

  • Endpoint: https://api.kimi.com/coding/
  • Protocol: Anthropic Messages API (not OpenAI-compatible)
  • Model name: kimi-for-coding
  • Context window: 256K tokens
  • Max output: 64K tokens
  • Multimodal: Supported (based on K2.5, can handle visual inputs like images)
  • API Key: Generate it in the Coding Plan page of the Kimi Code console; usage is also tracked on the same page

Example OpenClaw configuration

Add the following provider to your OpenClaw configuration file:

Configuration notes:

  1. Set the API Key as the environment variable KIMI_CODE_API_KEY, using the key generated on the Coding Plan page
  2. api must be anthropic-messages; going through the OpenAI-compatible path returns 403 or 404 errors
  3. cost is set to 0 because the Coding Plan is a subscription, not per-token billing
  4. input includes text and image, indicating multimodal input support

Gotchas

  • Some OpenClaw versions may have compatibility issues with tool calls; if your call chain breaks, watch for version updates
  • Kimi Code officially permits use in Claude Code and Roo Code; connecting it to OpenClaw is a “non-officially-supported product” and carries a risk of being flagged as abuse—evaluate this yourself

Suitable use cases

This fits users who already have a Kimi Code subscription and want to reuse their quota within OpenClaw. If you don’t have a Kimi Code subscription yet, you’ll first need to sign up for a membership plan at kimi.com.

Update note: the provider name changed from kimi-code to kimi-plan to avoid colliding with a built-in OpenClaw name.