Pydantic AI v2.51.0 (2026-09-25)
Pydantic AI v2.51.0 introduces OpenAILiveModel support, context window tracking for realtime sessions, compatibility adjustments for Gemini Live and OpenAI/Azure/xAI tool choices, and multiple performance optimizations.
Why this signal matters
Pydantic AI version 2.51.0 brings several realtime model updates and performance enhancements. Features include the addition of OpenAILiveModel for OpenAI GPT-Live support and exposure of context window usage on realtime sessions via reported ratios or response usage. Breaking/compatibility updates enforce UserError when attempting to force realtime tool choices on OpenAI, Azure OpenAI, and xAI, reject Google affective dialog on Gemini 3.1 Flash Live and 3.8 Live during connection, handle dated gemini-3.8-live IDs, and raise RealtimeError for Gemini Live close codes. Bug fixes and performance improvements include caching the agent graph across Agent.run() calls, avoiding task groups for single-child toolset fan-outs, buffering text deltas during CompletedStreamedResponse replays, and preserving provider details on truncated or completed OpenAI Realtime tool-call responses.
Actionable summary
Pydantic AI v2.51.0 adds OpenAILiveModel and context window tracking for realtime sessions. Compatibility changes include raising UserError on forced realtime tool choices for OpenAI, Azure OpenAI, and xAI, handling dated gemini-3.8-live IDs, and raising RealtimeError on Gemini Live close codes. Core optimizations cache the agent graph during Agent.run() and eliminate redundant task groups.
- Agent usefulness
- 77/100
- Confidence
- 96%
- Canonical data
- JSON + Markdown
What builders should check
- Verify realtime tool choice configurations to avoid UserError if previously forcing tool calls on OpenAI, Azure OpenAI, or xAI.
- Update Gemini Live integrations to handle RealtimeError on close codes and remove affective dialog usage on Gemini 3.1 Flash Live and 3.8 Live.