Add Claude Opus 5.5 (`claude-opus-5-5`) support

Merged
DO
1mo ago
+1057-86

This pull request was posted by Claude Code using claude-opus-5-5 on behalf of Douwe.

Why we make these changes

Claude Opus 5.5 (claude-opus-5-5) was released today. Our profile flags match by prefix, so 'claude-opus-5' already matched it and it silently inherited Opus 5's profile. But Opus 5.5 shares three of Claude Fable 5.1's breaking changes, and the first one breaks the default structured-output path: Agent('anthropic:claude-opus-5-5', output_type=SomeModel) currently fails with a 400 (tool_choice: type "tool" and "any" are not supported for this model).

I probed every profile flag live against the API, with claude-opus-5 side by side. Opus 5.5 matches Opus 5 except on these three changes; the first two reuse the Fable 5.1 flags:

  • A forced tool_choice returns a 400, so it gets anthropic_supports_forced_tool_choice=False, and Tool Output falls back to auto.
  • Thinking blocks are bound to the conversation prefix, so it gets anthropic_binds_thinking_blocks=True and the stale-block retry.
  • thinking: {'type': 'disabled'} is rejected at every effort level, so Opus 5's xhigh/max guard is turned off for it. Unified thinking=False already sends no thinking field.

It also adds the id to KnownModelName (anthropic, gateway, and Bedrock us./global., verified with list_inference_profiles) and to AdvisorModelName. anthropic is bumped to 1.8.0, the first release that lists the id, through a per-package exclude-newer cutoff like #7989, tracked for removal in #8636. That bump required two SDK type updates: BetaCitationsConfigParamParam, and the widened BetaInputTransformation union. The gh-aw runner's own lock (.github/scripts/pydantic-ai-runner.lock) is refreshed to match; it was already stale on main, so the refresh also picks up that drift.

Pricing lives in genai-prices, which currently prices Opus 5.5 as Opus 5 ($5/$25 instead of $4/$20). The fix is pydantic/genai-prices#709. Users who call prices.update_in_background() get it as soon as that merges. Everyone else gets it from the next genai-prices release, which the existing genai-prices>=0.1.7 range already allows.

New public surface

None. The claude-opus-5-5 literals are additions to existing Literal aliases.

User-visible behavior

Agent('anthropic:claude-opus-5-5', output_type=City).run_sync('Capital of France?')
# before: ModelHTTPError 400: tool_choice: type "tool" and "any" are not supported for this model.
# after:  City(name='Paris', ...), sent with tool_choice={'type': 'auto'} and tools filtered to the output tool

Verification

What changes for existing users

The anthropic extra now requires anthropic>=1.8.0, and every model other than claude-opus-5-5 keeps its current profile.

Checklist

  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration, release note, and exact API-check waiver.
  • PR title is fit for the release changelog.

šŸ¤– Generated with Claude Code