Skip to content

Kimi

o4 includes the official Moonshot Open Platform API as the built-in kimi-coding provider. It speaks the OpenAI-compatible Chat Completions protocol at https://api.moonshot.ai/v1.

Create a key in the console and export it for o4:

Terminal window
export KIMI_API_KEY="your-moonshot-api-key"

Verify the embedded catalog:

Terminal window
o4 --list-models

The output includes:

Provider: kimi-coding
kimi-k2-turbo-preview

Start a session:

Terminal window
o4 -m kimi-coding:kimi-k2-turbo-preview
Model id Context Max output Reasoning
kimi-k2-turbo-preview 262,144 8,192 low, high, max

The model supports reasoning effort levels low, high, and max. Use /reasoning in an interactive session or --reasoning max on the CLI to select the thinking effort.

Kimi uses the standard OpenAI Chat Completions endpoint:

POST https://api.moonshot.ai/v1/chat/completions
Authorization: Bearer <your-api-key>

o4 sends reasoning_effort (low/high/max) and a thinking extra body to control reasoning. Reasoning content is streamed back via the reasoning_content field in delta chunks.

The API key is read from KIMI_API_KEY:

Terminal window
export KIMI_API_KEY="your-moonshot-api-key"

Or open /config, select kimi-coding, and save the key in o4’s settings.

Terminal window
export KIMI_API_KEY="your-moonshot-api-key"

Check that you are using a Moonshot Open Platform key, not a Kimi Code membership key. The two services use different endpoints and keys.

Moonshot Open Platform usage is pay-as-you-go. A 429 indicates a rate limit or insufficient quota. Check the response detail for specifics.