Kimi K2 Has internal-provider related bugs

Hello Guys,

I am struggling to get kimi k2 to work without issues. I have tried the OpenAI-compatible api, which had problems, then I tried the anthropic variant, which was worse. Here are the errors I have. It is worth mentioning that I am using the Crush CLI tool by Charm.

Anthropic Error:

Screenshot 2025-08-15 at 2.02.50 AM

OpenAI Compatible:

Screenshot 2025-08-15 at 2.01.07 AM

Find below my configuration:

"Kimi_Anthropic": {

      "type": "anthropic",

"base_url": "https://api.moonshot.ai/anthropic",

"api_key": "$MOONSHOT_API_KEY",

"models": [

{

"id": "kimi-k2-turbo-preview",

"name": "K2 Turbo Anthropic",

"cost_per_1m_in": 0.3,

"cost_per_1m_out": 1.25,

"cost_per_1m_in_cached": 0.075,

"cost_per_1m_out_cached": 1.25,

"context_window": 262144,

"default_max_tokens": 65536,

"can_reason": true,

"supports_attachments": true

},

{

"id": "kimi-k2-0711-preview",

"name": "Kimi K2 (131K) — Moonshot AI",

"cost_per_1m_in": 0.60,

"cost_per_1m_out": 2.50,

"cost_per_1m_in_cached": 0.15,

"cost_per_1m_out_cached": 2.50,

"context_window": 131072,

"default_max_tokens": 16384,

"can_reason": true,

"supports_attachments": false

}

]

}

},


Openai supports some new formats, and the Crush CLI in your example uses this latest format.https://platform.openai.com/docs/api-reference/chat/create (That chat completion request body’s message content in array type rather than string type.)
After receiving your feedback, we made adjustments in a timely manner, and we also used the following config for the latest tests, which can be used normally.
You can retest, and if you have any other questions, please feel free to contact us at any time. Thank you for your support and feedback.

Here is our config :
~/.config/crush/crush.json

{
    "$schema": "https://charm.land/crush.json",
    "providers": {
        "MoonshotAI": {
            "type": "openai",
            "base_url": "https://api.moonshot.ai/v1",
            "api_key": "sk-xxxxx",
            "models": [
                {
                    "id": "kimi-k2-turbo-preview",
                    "name": "kimi-k2-turbo-preview",
                    "cost_per_1m_in": 2.4,
                    "cost_per_1m_out": 10.0,
                    "cost_per_1m_in_cached": 0.6,
                    "context_window": 131072,
                    "default_max_tokens": -1,
                    "can_reason": false,
                    "supports_attachments": false
                }
            ]
        }
    }
}
1 Like

Thanks so much, Cellen. I have confirmed that this is fixed and is working fine.

1 Like