What version of Kimi Code is running?
0.42.0 (also verified present on latest main, commit b180725)
Which open platform/subscription were you using?
A custom registry (api.json, models.dev format) with OpenAI/Anthropic-compatible providers.
Which model were you using?
Any model imported from a custom registry whose advertised limit.output is below its context size (e.g. models with an 8k output cap).
What platform is your computer?
Linux x86_64 (platform-independent — the issue is in how registry data is imported).
What issue are you seeing?
When models are imported from a custom registry (api.json), each entry's advertised limit.output is ignored: the generated model alias never records maxOutputSize. The request's completion-token cap then falls back to the model's full context size and is sent as the protocol's output-token field — max_output_tokens for openai_responses, max_completion_tokens/max_tokens for openai chat-completions, and max_tokens for anthropic (which additionally falls back to a 128000 default for unrecognized model ids). Any registry model whose real output cap is smaller rejects the request, e.g.:
400 "Invalid max_output_tokens"
What steps can reproduce the bug?
- Configure a custom registry whose model entry advertises a modest output limit, e.g. an
openai_responses registry with this api.json entry:
{
"models": {
"example-model": {
"id": "example-model",
"name": "Example Model",
"limit": { "context": 1000000, "output": 8192 }
}
}
}
- Import that registry and select the model.
- Send any prompt.
- The request goes out with
max_output_tokens ≈ 1000000 (the full advertised context size, since no output limit was recorded), and the provider responds 400 "Invalid max_output_tokens" because that exceeds the model's real 8192 output cap.
What is the expected behavior?
kimi-code records the registry's advertised limit.output as the model's max output size and sends a compliant output-token cap, the same way limit.context is already honored for maxContextSize.
Additional information
- Verified against the live models.dev dataset (~7700 models): every chat model publishes
limit.output as a positive integer, so the field is reliable to consume.
- The models.dev integration path already maps this field to
maxOutputSize; the custom-registry import path is the only one that drops it.
- Affects all custom-registry provider types (
openai, openai_responses, anthropic, kimi) since the completion-budget cap is protocol-agnostic.
- I am willing to submit a PR for this bug fix myself (waiting for maintainer approval in this issue first, per the contributing policy).
What version of Kimi Code is running?
0.42.0 (also verified present on latest
main, commit b180725)Which open platform/subscription were you using?
A custom registry (
api.json, models.dev format) with OpenAI/Anthropic-compatible providers.Which model were you using?
Any model imported from a custom registry whose advertised
limit.outputis below its context size (e.g. models with an 8k output cap).What platform is your computer?
Linux x86_64 (platform-independent — the issue is in how registry data is imported).
What issue are you seeing?
When models are imported from a custom registry (
api.json), each entry's advertisedlimit.outputis ignored: the generated model alias never recordsmaxOutputSize. The request's completion-token cap then falls back to the model's full context size and is sent as the protocol's output-token field —max_output_tokensforopenai_responses,max_completion_tokens/max_tokensforopenaichat-completions, andmax_tokensforanthropic(which additionally falls back to a 128000 default for unrecognized model ids). Any registry model whose real output cap is smaller rejects the request, e.g.:What steps can reproduce the bug?
openai_responsesregistry with thisapi.jsonentry:{ "models": { "example-model": { "id": "example-model", "name": "Example Model", "limit": { "context": 1000000, "output": 8192 } } } }max_output_tokens≈ 1000000 (the full advertised context size, since no output limit was recorded), and the provider responds400 "Invalid max_output_tokens"because that exceeds the model's real 8192 output cap.What is the expected behavior?
kimi-code records the registry's advertised
limit.outputas the model's max output size and sends a compliant output-token cap, the same waylimit.contextis already honored formaxContextSize.Additional information
limit.outputas a positive integer, so the field is reliable to consume.maxOutputSize; the custom-registry import path is the only one that drops it.openai,openai_responses,anthropic,kimi) since the completion-budget cap is protocol-agnostic.