Source · release
Pydantic AI v2.62.0
Summary
Pydantic AI 2.62.0 (2026-10-26) adds control over subagents you have delegated to, compaction that the model can ask for, and support for provider batch APIs. It also lets you change the thinking effort partway through a conversation on OpenAI and Anthropic.
Key points
- Steerable subagents: with
task_controlturned on,SubAgentsdelegations can run in the background, and you can steer, answer, or cancel them. - Compaction: the
CompactOnRequestcapability lets the model ask for compaction at a natural break in a task.AnthropicModel.compact_messages()runs Anthropic's native compaction when you call it. - Batch APIs: the
BatchModelRequestscapability sends requests through provider batch APIs, which are usually cheaper but slower. - Effort mid-conversation: you can change thinking effort between turns. It uses
OpenAI
configuration_updateand Anthropic's per-messageoutput_config. - Hosted MCP: tool names now start with the service name by default (set
tool_prefixto change it), andauthcan be an async function. - Durable runs: tool calls can run as Temporal child workflows when you set
child_workflowmetadata. - Cost and caching:
RequestUsage.costuses the cost reported by the Pydantic AI Gateway. On OpenAI Chat Completions,allowed_toolslimitstool_choicewithout changing the tool list, so the prompt cache still hits. - Errors: new error types for rejected requests, authentication failures, and unknown models.
- Upgrade with
pip install -U pydantic-ai.
Why it matters
Steerable background subagents and compaction the model can request bring Pydantic AI closer to how coding agents such as Claude Code handle long multi-agent work. Batch support is a direct cost saving for offline jobs.