Add Claude Opus 5.5 (`claude-opus-5-5`) support
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_choicereturns a 400, so it getsanthropic_supports_forced_tool_choice=False, and Tool Output falls back toauto. - Thinking blocks are bound to the conversation prefix, so it gets
anthropic_binds_thinking_blocks=Trueand the stale-block retry. thinking: {'type': 'disabled'}is rejected at every effort level, so Opus 5'sxhigh/maxguard is turned off for it. Unifiedthinking=Falsealready sends nothinkingfield.
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
test_opus_5_5_basemodel_output_falls_back_to_auto: cassette of the fix above, asserting the outboundtool_choice.test_anthropic_explicit_error_rejects_a_stale_thinking_block_on_binding_models: cassettes showing Opus 5.5 rejects a stale thinking block and Opus 5 accepts it, which is the evidence for the binding flag.test_anthropic_drops_a_stale_thinking_block[claude-opus-5-5]records thedrop_blockshape the retry sends.test_model_profile_opus_5_5: pins the profile as Opus 5's plus exactly the three differences.test_anthropic_opus_5_5_featuresandtest_anthropic_opus_5_5_thinking_false_omits_thinkingare recorded evidence that adaptive +xhighandthinking=Falsework live.
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.
- Related: #8636
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