python Pydantic AI Releases · · 2.20.0

pydantic-ai v2.20.0: New Claude Opus, OpenAI Responses API, and Usage Fixes

sdkaipython-agentic
feature patch

This release of pydantic-ai introduces support for Claude Opus 5 and enhances the OpenAI Responses API with reasoning context. It also includes several bug fixes, such as preserving arbitrary usage fields, capturing Anthropic thinking tokens, and correcting handling for embeddings and tool-search history. These updates are beneficial for developers integrating AI models, particularly those using Anthropic, OpenAI, and Vertex AI.

  • Add Claude Opus 5 (claude-opus-5) support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6723
  • Preserve arbitrary RequestUsage fields across serialization by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/6685
  • Capture Anthropic thinking tokens in usage details by @jakub-orsula-parrot in https://github.com/pydantic/pydantic-ai/pull/6753
  • Fix ALLOW_MODEL_REQUESTS guards for embeddings by @zcxGGmu in https://github.com/pydantic/pydantic-ai/pull/6774
  • Skip include_server_side_tool_invocations for Vertex on Gemini 3+ by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6773
Features (2)
  • Add Claude Opus 5 (claude-opus-5) support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6723
  • Add OpenAI Responses API reasoning.context support (default all_turns) for the gpt-5.4/gpt-5.5/gpt-5.6 families by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6673

Fixes (9)
  • Preserve arbitrary RequestUsage fields across serialization by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/6685
  • Capture Anthropic thinking tokens in usage details by @jakub-orsula-parrot in https://github.com/pydantic/pydantic-ai/pull/6753
  • Fix ALLOW_MODEL_REQUESTS guards for embeddings by @zcxGGmu in https://github.com/pydantic/pydantic-ai/pull/6774
  • Skip include_server_side_tool_invocations for Vertex on Gemini 3+ by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6773
  • Fix _openrouter_settings_to_openai_settings mutating caller's settings dict by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6743

  • Replay tool-search history across provider boundaries instead of dropping it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6780
  • Preserve zero-valued OpenTelemetry usage details by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6796
  • Expose OpenAI Responses phase on the streamed PartStartEvent by @Jonas1312 in https://github.com/pydantic/pydantic-ai/pull/6785
  • Make a bare McpError from an MCP server recoverable instead of fatal by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6787
Read the original announcement →

https://github.com/pydantic/pydantic-ai/releases/tag/v2.20.0

Related releases