Description
claude-opus-4-7 returns a 400 error because Hermes sends thinking: {type: "enabled", budget_tokens: N} which is not supported by this model. Opus 4-7 requires thinking: {type: "adaptive"} with output_config: {effort: ...} instead.
Error
BadRequestError [HTTP 400]
"thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort" to control thinking behavior.
Root Cause
The fix from #1126 / PR #1128 hardcoded version checks for "4-6" and "4.6" only in _supports_adaptive_thinking():
def _supports_adaptive_thinking(model):
return any(v in model for v in ("4-6", "4.6"))
claude-opus-4-7 doesn't match, so it falls through to the old code path that sends thinking: {type: "enabled"}.
The _ANTHROPIC_OUTPUT_LIMITS dict also has no entry for claude-opus-4-7.
Suggested Fix
- Update
_supports_adaptive_thinking() to also match "4-7" / "4.7" (or ideally use a >= comparison to future-proof).
- Add
claude-opus-4-7 to _ANTHROPIC_OUTPUT_LIMITS.
- Note: opus 4-7 also removes support for
temperature, top_p, and top_k parameters entirely (400 errors). These may need to be stripped as well.
Additional Opus 4-7 API Changes
thinking.type must be "adaptive" (both "enabled" and "disabled" return 400)
budget_tokens replaced by output_config.effort (low / medium / high / xhigh / max)
"xhigh" effort level is new and exclusive to opus 4-7
max_tokens now covers both thinking + response output
- New tokenizer uses 1x-1.35x more tokens
Environment
- Hermes Agent (latest from main)
- Provider: Anthropic (direct API)
- Model:
claude-opus-4-7
Description
claude-opus-4-7returns a 400 error because Hermes sendsthinking: {type: "enabled", budget_tokens: N}which is not supported by this model. Opus 4-7 requiresthinking: {type: "adaptive"}withoutput_config: {effort: ...}instead.Error
Root Cause
The fix from #1126 / PR #1128 hardcoded version checks for
"4-6"and"4.6"only in_supports_adaptive_thinking():claude-opus-4-7doesn't match, so it falls through to the old code path that sendsthinking: {type: "enabled"}.The
_ANTHROPIC_OUTPUT_LIMITSdict also has no entry forclaude-opus-4-7.Suggested Fix
_supports_adaptive_thinking()to also match"4-7"/"4.7"(or ideally use a>=comparison to future-proof).claude-opus-4-7to_ANTHROPIC_OUTPUT_LIMITS.temperature,top_p, andtop_kparameters entirely (400 errors). These may need to be stripped as well.Additional Opus 4-7 API Changes
thinking.typemust be"adaptive"(both"enabled"and"disabled"return 400)budget_tokensreplaced byoutput_config.effort(low/medium/high/xhigh/max)"xhigh"effort level is new and exclusive to opus 4-7max_tokensnow covers both thinking + response outputEnvironment
claude-opus-4-7