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_control turned on, SubAgents delegations can run in the background, and you can steer, answer, or cancel them.
  • Compaction: the CompactOnRequest capability 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 BatchModelRequests capability 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_update and Anthropic's per-message output_config.
  • Hosted MCP: tool names now start with the service name by default (set tool_prefix to change it), and auth can be an async function.
  • Durable runs: tool calls can run as Temporal child workflows when you set child_workflow metadata.
  • Cost and caching: RequestUsage.cost uses the cost reported by the Pydantic AI Gateway. On OpenAI Chat Completions, allowed_tools limits tool_choice without 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.