Skip to content

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

Open

Description

@L33chKing

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.

Activity

  1. github-actions commented on Sep 6, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or related to existing issues about the Go gateway forwarding parameters that strict upstream validators reject. Please check:

    The n parameter issue you describe is a distinct specific case (the upstream kimi-k3 model declares n: None and rejects any provided value, including the OpenAI-default n=1), but it falls into the same general class of the gateway not sanitizing/stripping incompatible parameters per-model before forwarding.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the clear report and the curl reproduction. Testing this needs a real OpenCode Go API key so the request reaches the kimi-k3 upstream, and our automated environment doesn't have one. Without a key, the endpoint rejects the request before it gets as far as checking n. The problem is in the hosted Go gateway (or the upstream behind it) rather than in the OpenCode app, which doesn't send n itself, so a maintainer with Go access will need to confirm it.

    Related reports:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions