anomalyco / anomalyco/opencode

Go endpoint: kimi-k3 rejects 'n' parameter (400: n: Input should be None)

Open
#47,568 1 comment 0 reactions 1 assignee View on GitHub

@fwang is already working on this.

Since Sep 6, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Bug

The OpenCode Go endpoint (https://opencode.ai/zen/go/v1/chat/completions) returns HTTP 400 for kimi-k3 whenever the request includes the n parameter — even the OpenAI-default n: 1:

{
  "error": {
    "type": "server_error",
    "message": "Error from provider (Console Go): Upstream request failed: n: Input should be None"
  }
}

Reproduction

curl https://opencode.ai/zen/go/v1/chat/completions \
  -H "Authorization: Bearer $OPENCODE_GO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"kimi-k3","messages":[{"role":"user","content":"Say OK"}],"max_tokens":16,"n":1}'

-> 400 with the error above. The same request without n succeeds.

Scope

  • Affects kimi-k3 with any reasoning_effort value (low/medium/high/max) and also with no effort parameter at all.
  • Other Go models tested (kimi-k2.6, kimi-k2.7-code, glm-5.3, minimax-m3, mimo-v2.5) accept n: 1 fine — the bug is specific to kimi-k3's upstream validation.

Impact

Any OpenAI-compatible client that always sends n: 1 (VS Code Copilot Chat custom models, several SDKs) cannot use kimi-k3 on the Go plan at all. Presumably the upstream model's pydantic schema declares n: None = None and rejects any provided value instead of ignoring n=1.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.