MoonshotAI / MoonshotAI/kimi-code

MS Foundry + Kimi Code 2.7 - 400 Unrecognized request argument supplied: prompt_cache_key

Open
#2,611 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

What version of Kimi Code is running?

0.32.0

Which open platform/subscription were you using?

.

Which model were you using?

kimi-k2.7-code

What platform is your computer?

Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

Kimi Code CLI sends prompt_cache_key in a request to an OpenAI-compatible endpoint, and the endpoint rejects it with HTTP 400: Unrecognized request argument supplied: prompt_cache_key.

Config (redacted)
default_model = "azure/kimi-k2.7-code"

[providers.azure-foundry]
type = "openai"
base_url = "https://<redacted>/openai/v1"
api_key = "<redacted>"

[providers.azure-foundry.custom_headers]
api-key = "<redacted>"

[models."azure/kimi-k2.7-code"]
provider = "azure-foundry"
model = "Kimi-K2.7-Code"
max_context_size = 262144
capabilities = [ "thinking", "tool_use", "image_in" ]
reasoning_key = "reasoning_content"

[thinking]
enabled = false



### What steps can reproduce the bug?

### Steps to reproduce

1. Configure provider/model as above.
2. Start a session (simple prompt like test).
3. First LLM turn fails.

### What is the expected behavior?

_No response_

### Additional information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the Kimi Code CLI builds the first request for the configured OpenAI-compatible provider and where prompt_cache_key is added. Reproduce the failure with the supplied Azure Foundry configuration, then verify that the session starts successfully without sending an argument the endpoint rejects.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.