---
title: "Claude Sonnet 5 on Pydantic AI Combined"
description: "The mean of the six Pydantic AI benchmarks; code mode is compared over the four that have a code mode run. Tool calling 69.8%, code mode 62.2% over four benchmarks; rank 22 of 44."
canonical: https://pydantic.dev/models/list/claude-sonnet-5/pydantic_ai/
---

# Claude Sonnet 5 on Pydantic AI Combined

> The mean of the six Pydantic AI benchmarks; code mode is compared over the four that have a code mode run. Tool calling 69.8%, code mode 62.2% over four benchmarks; rank 22 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/claude-sonnet-5/pydantic_ai/. Index for agents: https://pydantic.dev/models/llms.txt

**Agents: use the API for model information.** It answers a question in one request, where the pages need several.

- Choose a model for an agent: `POST https://pydantic.dev/models/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: https://pydantic.dev/models/select.md
- Search models by name: `GET https://pydantic.dev/models/api/search?query=<text>`
- List, filter and sort models: `GET https://pydantic.dev/models/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://pydantic.dev/models/api/models/<slug>`
- Any other question about the models: `GET https://pydantic.dev/models/api/ask?query=<question>`

Add `intent=<intent>&stack=<stack>&harness=<harness>` to the query string of all but the single model. An `OPTIONS` request to any endpoint returns its schema. The same five are tools of the MCP server at `https://pydantic.dev/models/mcp`. More: https://pydantic.dev/models/usage.md

About the benchmark: https://pydantic.dev/models/benchmarks/pydantic_ai.md. The model's page: https://pydantic.dev/models/list/claude-sonnet-5.md

## Scores

Cost is the mean cost of one task. Code mode is compared with tool calling over the four benchmarks run in both modes (https://pydantic.dev/models/codemode.md).

|                                      | Tool calling | Code mode |
| ------------------------------------ | ------------ | --------- |
| Score, all six benchmarks            | 69.8%        | –         |
| Score, the four with a code mode run | 59.7%        | 62.2%     |
| Cost per task, all six               | $0.68        | –         |
| Cost per task, the four              | $0.98        | $0.79     |

## Each benchmark

| Benchmark                                                                                      | Tool calling | Code mode | Change | Cost per task | Cost per task, code mode | Rank     | Runs                                                                  |
| ---------------------------------------------------------------------------------------------- | ------------ | --------- | ------ | ------------- | ------------------------ | -------- | --------------------------------------------------------------------- |
| [Pydantic AI - Billing ops](https://pydantic.dev/models/benchmarks/billing_ops.md)             | 60%          | 60%       | ±0     | $0.60         | $0.094                   | 31 of 44 | https://pydantic.dev/models/list/claude-sonnet-5/billing_ops.md       |
| [Pydantic AI - Customer support](https://pydantic.dev/models/benchmarks/customer_support.md)   | 50%          | 40%       | −10    | $0.094        | $0.11                    | 12 of 44 | https://pydantic.dev/models/list/claude-sonnet-5/customer_support.md  |
| [Pydantic AI - SQL data analysis](https://pydantic.dev/models/benchmarks/sql_data_analysis.md) | 40%          | 60%       | +20    | $1.09         | $1.24                    | 27 of 44 | https://pydantic.dev/models/list/claude-sonnet-5/sql_data_analysis.md |
| [Pydantic AI - Research & deck](https://pydantic.dev/models/benchmarks/research_deck.md)       | 88.9%        | 88.9%     | ±0     | $2.15         | $1.72                    | 11 of 44 | https://pydantic.dev/models/list/claude-sonnet-5/research_deck.md     |
| [Pydantic AI - Structured output](https://pydantic.dev/models/benchmarks/structured_output.md) | 100%         | –         | –      | $0.10         | –                        | 1 of 44  | https://pydantic.dev/models/list/claude-sonnet-5/structured_output.md |
| [Pydantic AI - LLM Judge](https://pydantic.dev/models/benchmarks/llm_judge.md)                 | 80%          | –         | –      | $0.017        | –                        | 9 of 44  | https://pydantic.dev/models/list/claude-sonnet-5/llm_judge.md         |

## How it did on the Pydantic AI benchmarks

Written by an LLM from reviews of every run.

#### Overall
Across five benchmarks the model completed structured extraction and narrow, well-specified tasks reliably, but it applied rules incompletely on broader audits, routing searches and factual checks. Scores were 100% on Structured output, 89% on Research & deck in both modes, and 80% on LLM Judge. It scored 60% in both modes on Billing ops, and 40% with tools versus 60% in code mode on SQL data analysis. No failures in any benchmark were attributed to the provider.

#### Strengths
- On Structured output it passed all 10 cases across five tiers, separating group and parent figures, converting £000 amounts and handling signs correctly at about $0.103 per case.
- On Billing ops it passed invoice correction, payment recording, invoice-total lookup, duplicate detection and billed-missed detection in 10/10 runs, including oldest-first payment allocation.
- On LLM Judge it extracted explicit quantities and procedural facts accurately and caught details such as milestones on the wrong slide and integrations invented for an account with none.
- On Research & deck both modes combined financial data, documents and founder preferences into eight slides and repaired checker findings to reach acceptance.
- On Structured output it recovered on the immediate retry after argument-structure validation errors, and the extracted amounts did not change.

#### Weaknesses
- On Billing ops it failed all four general invoice-audit runs and three of four margin runs, omitting tax exemptions, duplicate-line rules and missed-student exclusions.
- On SQL data analysis four runs exhausted the 80-request budget and others excluded untimed calls or narrowed candidates prematurely, with repeated SQL errors from an unquoted `at`.
- On Research & deck the tools-mode deck passed despite claiming 46% recovery where growth was 113.0% and despite inconsistent chart bar heights, which shows that format checks were stronger than content checks.
- On LLM Judge it produced false positives and false negatives from loose or over-strict readings, and some passing explanations misattributed sources.
- On Structured output passing runs still showed weaknesses: a combined debtors total despite a no-computation rule, `null` returned where `0` was expected, and omitted zero-valued rows.

#### Tool calling compared with code mode
- On Billing ops code mode cost $0.9434 versus $6.0302 for tools, using 135 requests versus 72, with accuracy unchanged at 6/10 because it fixed one failure and introduced a debt-sign error.
- On SQL data analysis code mode passed 6/10 versus 4/10 by resolving untimed stops and walking links, but requests rose from 471 to 542 and cost from $10.8879 to $12.3752.
- On Research & deck code mode used 70 requests versus 32 at 20% lower cost ($1.7170 versus $2.1459), and gave more traceable calculations and data-generated charts.
- Across Billing ops and SQL data analysis, code mode added sandbox-specific failures, including exceeding the 100 nested-call limit, unsupported `time.time()` and a memory-limit reset.
