Anthropic claude pro subscription: temperature and top_p cannot both be specified for this model. Please use only one. #4556

Closed
opened 2026-02-16 17:44:35 -05:00 by yindo · 3 comments
Owner

Originally created by @imqqmi on GitHub (Jan 9, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

I have my agents setup with temperature, top_k and top_p before and worked fine with Claude on openrouter.

Today I got a claude pro subscription with Anthropic but ran into this issue. I removed all the temperature, top_k and top_p from my opencode.json file (in my project folder as well as ~/.config/opencode) but it still gives this error:
temperature and top_p cannot both be specified for this model. Please use only one.

Is it still adding these values by default?

Plugins

None

OpenCode version

1.1.8

Steps to reproduce

opencode auth login
antrhopic pro subscription > register with link > copy confirmation code
Succesfully registered
opencode . in my project folder (wsl2 on windows 10)
/m choose anthropic claude opus, sonnet or haiku model
enter Hello

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @imqqmi on GitHub (Jan 9, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description I have my agents setup with temperature, top_k and top_p before and worked fine with Claude on openrouter. Today I got a claude pro subscription with Anthropic but ran into this issue. I removed all the temperature, top_k and top_p from my opencode.json file (in my project folder as well as ~/.config/opencode) but it still gives this error: `temperature` and `top_p` cannot both be specified for this model. Please use only one. Is it still adding these values by default? ### Plugins None ### OpenCode version 1.1.8 ### Steps to reproduce opencode auth login antrhopic pro subscription > register with link > copy confirmation code Succesfully registered opencode . in my project folder (wsl2 on windows 10) /m choose anthropic claude opus, sonnet or haiku model enter Hello ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the windowsbug labels 2026-02-16 17:44:35 -05:00
yindo closed this issue 2026-02-16 17:44:35 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 9, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #1644: AI_APICallError: temperature and top_p cannot both be specified for this model - Same error message with Anthropic Claude Opus when a custom temperature is configured

Feel free to ignore if this doesn't address your specific case.

@github-actions[bot] commented on GitHub (Jan 9, 2026): This issue might be a duplicate of existing issues. Please check: - #1644: AI_APICallError: `temperature` and `top_p` cannot both be specified for this model - Same error message with Anthropic Claude Opus when a custom temperature is configured Feel free to ignore if this doesn't address your specific case.
Author
Owner

@imqqmi commented on GitHub (Jan 9, 2026):

Also happens when I try this in windows powershell. I've removed both opencode.json files and it still happens.

I have not used opencode with the source code of opencode as in the suggested link above.

@imqqmi commented on GitHub (Jan 9, 2026): Also happens when I try this in windows powershell. I've removed both opencode.json files and it still happens. I have not used opencode with the source code of opencode as in the suggested link above.
Author
Owner

@imqqmi commented on GitHub (Jan 9, 2026):

I've found the issue. Apparently OpenCode also looks at folders higher in the folder structure for opencode.json.
ie
~/Projects/MyApp/opencode.json
~/Projects/opencode.json

Run opencode in
cd ~/Projects/MyApp/
opencode .
Finds ~/Projects/opencode.json and uses it, which contained the temperature and top_k definitions.

@imqqmi commented on GitHub (Jan 9, 2026): I've found the issue. Apparently OpenCode also looks at folders higher in the folder structure for opencode.json. ie ~/Projects/MyApp/opencode.json ~/Projects/opencode.json Run opencode in cd ~/Projects/MyApp/ opencode . Finds ~/Projects/opencode.json and uses it, which contained the temperature and top_k definitions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4556