# Pydantic AI v2.51.0 (2026-09-25)

Category: agent-infrastructure
Published: 2026-09-25T23:19:04Z
Source: [Pydantic AI releases](https://github.com/pydantic/pydantic-ai/releases/tag/v2.51.0)
Agent usefulness: 77/100
Confidence: 0.96
Content mode: release-watch
Verified: 2026-09-26T00:17:47.059Z
Tags: pydantic-ai, typed-agents, python

## Human Summary
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.

## Agent Summary
Pydantic AI released v2.51.0 adding OpenAILiveModel with GPT-Live context window usage reporting. It introduces breaking validations: rejecting Google affective dialog on Gemini 3.1/3.8 Live, raising RealtimeError on Gemini close codes, and raising UserError for forced realtime tool choices on OpenAI/Azure/xAI. Key optimizations include caching agent graphs across Agent.run() calls and reducing RunContext copy…

## Body
Pydantic AI v2.51.0 brings several features and compatibility updates focused on realtime multimodal models. Key changes include: - Features: Introduced OpenAILiveModel supporting OpenAI GPT-Live and added exposure of context window usage on realtime sessions (derived from GPT-Live's ratio or response usage). - Compatibility & Validation: Now matches dated gemini-3.8-live IDs, rejects Google affective dialog on Gemini 3.1 Flash Live and 3.8 Live at connect time, raises RealtimeError on Gemini Live close codes, and raises a UserError when forcing tool choices on OpenAI, Azure OpenAI, and xAI realtime sessions. - Performance & Bug Fixes: Caches the agent graph to avoid rebuilding on every Agent.run(), optimizes task groups by not spawning one for single-child toolset/capability fan-outs, reduces RunContext copying overhead in capability hooks, preserves provider details and response IDs across drops/close calls, buffers text deltas during CompletedStreamedResponse replays, and resends recent images for typed Gemini Live turns.

## Recommended actions
- Check realtime tool choice configurations when using OpenAI, Azure OpenAI, or xAI to avoid forced tool call UserErrors.
- Remove affective dialog configurations when connecting to Gemini 3.1 Flash Live or 3.8 Live.
- Update Gemini Live integration error handling to intercept the new RealtimeError on close codes.

## Sponsors
No sponsor placement attached.

## Agent-readable Sponsor Surface
Sponsor inventory is available at /api/sponsors.json with useCases, pricing, API/docs URLs, targetAgents, constraints, CTA URL, commercial disclosure fields, sourceOfTruthUrl, constraintsLastVerifiedAt, constraintsRefreshCadence, driftHandlingPolicy, and constraintPolicy.