invalid_request_error","message":"`max_tokens` must be greater than `thinking.budget_tokens`.
Duplicate PR
#340
wait, I still got this error when using kilocode with the latest commit
OpenAI completion error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"max_tokens must be greater than thinking.budget_tokens. Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking#max-tokens-and-context-window-size"},"request_id":"req_vrtx_011CVY6Kd4nhjQfgPQKNCvb1"}
Originally posted by @huynguyen03dev in https://github.com/router-for-me/CLIProxyAPI/issues/348#issuecomment-3584742137
You should attach the request log here.
================
[2025-12-04 15:34:36] [info] [service.go:543] file watcher started for config and auth directory changes
[2025-12-04 15:34:36] [info] [service.go:549] core auth auto-refresh started (interval=15m0s)
[2025-12-04 15:34:37] [debug] [updater.go:235] management asset is already up to date
[2025-12-04 15:34:37] [debug] [model_registry.go:334] Registered new model gemini-claude-sonnet-4-5 from provider antigravity
[2025-12-04 15:34:37] [debug] [model_registry.go:334] Registered new model gemini-3-pro-preview from provider antigravity
[2025-12-04 15:34:37] [debug] [model_registry.go:334] Registered new model gemini-3-pro-image-preview from provider antigravity
[2025-12-04 15:34:37] [debug] [model_registry.go:334] Registered new model gemini-claude-sonnet-4-5-thinking from provider antigravity
[2025-12-04 15:34:37] [debug] [model_registry.go:334] Registered new model gemini-2.5-flash-image from provider antigravity
[2025-12-04 15:34:37] [debug] [model_registry.go:334] Registered new model gemini-2.5-computer-use-preview-10-2025 from provider antigravity
[2025-12-04 15:34:37] [debug] [model_registry.go:334] Registered new model gemini-2.5-flash from provider antigravity
[2025-12-04 15:34:37] [debug] [model_registry.go:334] Registered new model gemini-2.5-flash-lite from provider antigravity
[2025-12-04 15:34:37] [debug] [model_registry.go:334] Registered new model gpt-oss-120b-medium from provider antigravity
[2025-12-04 15:34:37] [debug] [model_registry.go:334] Registered new model claude-opus-4-5-thinking from provider antigravity
[2025-12-04 15:34:37] [debug] [model_registry.go:166] Registered client antigravity-**********_gmail_com.json from provider antigravity with 10 models
[2025-12-04 15:34:37] [debug] [credentials.go:25] -------------------------------------------------------------------
[2025-12-04 15:34:41] [debug] [manager.go:477] Use OAuth **********@gmail.com for model gemini-claude-sonnet-4-5-thinking
[2025-12-04 15:34:44] [warning] [gin_logger.go:56] [GIN] 2025/12/04 - 15:34:44 | 400 | 2.681s | 127.0.0.1 | POST "/v1/chat/completions"
=================== in kilo code with openai protocol API Request Failed
OpenAI completion error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"max_tokens must be greater than thinking.budget_tokens. Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking#max-tokens-and-context-window-size"},"request_id":"req_vrtx_011CVmcfqTmNAYjCiLKhsMVB"}
with gemini protocol its works but not thinking
My pr resolves this issue in Kilo Code just fine, and the thinking block also shows up correctly
@huynguyen03dev The thinking block isn't appearing
You tried the code from my pr and the thinking block still not showing ?
Im using this branch https://github.com/huynguyen03dev/CLIProxyAPI/tree/huynguyen03dev and the thinking block shows everytime
thank you my mistake Im using main branch