v2.23.0

pydantic/pydantic-aiv2.23.0Aug 4, 2026by dsfaccini

AI Summary

Adds cost tracking functionality, restores stable model aliases, and improves Bedrock support by adding extra headers and tool availability rendering.

Key Highlights

  • Added `cost` to `RunUsage` and `cost_limit` to `UsageLimits`
  • Added `ToolAvailabilityDeltaPart` for native tool addition
  • Restored stable `gemini-3-pro-image` and `gemini-3.1-flash-image` aliases

New Features

  • Cost tracking (RunUsage, UsageLimits)
  • Bedrock support for `ModelSettings.extra_headers`
  • Native tool addition and additional tools rendering

Full Release Notes

<!-- Release notes generated using configuration in .github/release.yml at main -->

## What's Changed
### 🚀 Features
* Add Bedrock support for `ModelSettings.extra_headers` by @kkauy in https://github.com/pydantic/pydantic-ai/pull/4825
* Restore stable `gemini-3-pro-image` and `gemini-3.1-flash-image` Gateway aliases by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7069
* Add `cost` to `RunUsage` and `cost_limit` to `UsageLimits` by @Kludex in https://github.com/pydantic/pydantic-ai/pull/2684
* Add `ToolAvailabilityDeltaPart` with native `tool_addition` and `additional_tools` rendering by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6793
### 🐛 Bug Fixes
* Validate `bedrock_max_concurrency` instead of deadlocking on `0` by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6878
* Fix `GoogleCloudProvider` credential scoping and ADC auth env-var leak by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6500
* Read provider `created` timestamp from any chunk in OpenAI streaming responses by @LKRCharon in https://github.com/pydantic/pydantic-ai/pull/5496
* Preserve capability container subclasses during binding by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6677
* Drop the bound on the Temporal payload `TypeAdapter` cache by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7085
* Preserve the host's Pydantic AI instrumentation in the Temporal `LogfirePlugin` by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7086
* Fire capability event-stream and node hooks under `agent.iter()` by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6871
* Close async streams on teardown instead of waiting for the garbage collector by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7095

## New Contributors
* @ayaangazali made their first contribution in https://github.com/pydantic/pydantic-ai/pull/7020
* @kkauy made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4825
* @LHMQ878 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/6878
* @LKRCharon made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5496

**Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v2.22.0...v2.23.0