---
title: "Claude Sonnet 5.5 on Pydantic AI - Structured output"
description: "Extracting UK company accounts into a nested Pydantic model, checked against the filer's tags. Tool calling 100%; rank 1 of 44."
canonical: https://pydantic.dev/models/list/claude-sonnet-5.5/structured_output/
---

# Claude Sonnet 5.5 on Pydantic AI - Structured output

> Extracting UK company accounts into a nested Pydantic model, checked against the filer's tags. Tool calling 100%; rank 1 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/claude-sonnet-5.5/structured_output/. 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/structured_output.md. The model on every Pydantic AI benchmark: https://pydantic.dev/models/list/claude-sonnet-5.5/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | ---- |
| Tool calling | 100%  | 10 of 10     | $0.81 | 10       | 10         | 70 s |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

`claude-sonnet-5-5` passed all 10 cases of Structured output 0.3 in tool-calling mode, each in a single request. Every conversation has the same shape: the accounts text in the user message, then one `accounts` output call that validated first time. No case needed a retry after a failed check. Cost ran from $0.0625 to $0.0989 per case, $0.81 in total.

#### Where it does well

- **Scaling and signs.** In the £000 accounts (`tier1-07054261`, `tier1-11022760`, `tier2-SC121467`) it multiplied by 1,000. Deficits came back negative while creditors and costs stayed positive. Tax credits were negative (`tax` -571000 in `tier2-SC121467`, -51830 in `tier5-12026946`).
- **Group against parent.** In the six cases that ask for both (tiers 3 to 5), it kept the two sets of figures apart. That held even where they nearly match, such as prior `other` creditors of 103090 for the group against 102990 for the parent in `tier5-NI037684`.
- **Note mapping.** In all four cases with creditors notes it assigned lines to the right category and due band. It kept zero rows that have a prior amount, such as `bank_loans_and_overdrafts` 0 against prior 5836 in `tier4-NI626135`.
- **Details.** It listed a director who resigned mid-year in `tier5-12026946` and picked `medium` for `accounts_type` in `tier5-NI037684`.

#### Mistakes it makes

There were no scored errors. Two minor points, neither verifiable from the results:

- It fills fields the expected answer does not score, for example prior `cost_of_sales` 19900000 in `tier1-11022760` and group `creditors_after_one_year` 264243 in `tier4-05840865`. These may be right; they are simply unchecked.
- In `tier2-SC121467` it returned current `creditors_after_one_year` as 0, where it uses `null` for other absent lines.

The model's reasoning is not recorded, so I cannot say how much it cross-checked before answering. With ten first-attempt passes, this benchmark does not show how it reacts to a failed check.

## Runs

### tier1-07054261

**Tool calling: passed.** Read the Cube Logic accounts (presented in £000) and returned company details, balance sheet and profit and loss for both periods in a single `accounts` output call. Passed on the first request. ($0.089, 1 requests, 5 s)
- Right: Scaled £000 figures by 1,000 (e.g. `intangible_assets` 2640000)
- Right: Kept deficits negative: `net_assets` -6187000, `profit_and_loss_reserve` -8457000, `net_current_assets` -8967000
- Right: Used `null` for lines not shown (`stocks`, `provisions`, `creditors_after_one_year`)
- Right: One request, $0.0888

### tier1-11022760

**Tool calling: passed.** Extracted TaskUs Limited's company details, balance sheet and profit and loss for both periods in one `accounts` call. Passed on the first request. ($0.062, 1 requests, 5 s)
- Right: Scaled £000 figures and returned `called_up_share_capital` as 0 rather than `null`
- Right: Correct signs on `net_current_assets` -36631000 and prior `profit_before_tax` -1230000 with a positive tax charge of 632000
- Right: One request, $0.0625, the cheapest case
- Mistake: The output also filled lines the expected answer does not score (e.g. prior `cost_of_sales` 19900000); these could not be verified from the results

### tier2-11600506

**Tool calling: passed.** Returned Furat Acquisitions' consolidated balance sheet and profit and loss for both periods in one `accounts` call. Passed on the first request. ($0.073, 1 requests, 5 s)
- Right: Took group figures, not the parent's, in whole pounds with no scaling
- Right: Negative `net_assets` -2896388 and `profit_and_loss_reserve` -2896788 while `creditors_within_one_year` 10755412 stayed positive
- Right: One request, $0.0732

### tier2-SC121467

**Tool calling: passed.** Returned Franke UK Holding's consolidated balance sheet and profit and loss for both periods (£000 accounts) in one `accounts` call. Passed on the first request. ($0.083, 1 requests, 5 s)
- Right: Scaled £000 figures by 1,000
- Right: Handled the prior-year tax credit as negative (`tax` -571000) alongside the loss `profit_before_tax` -1678000
- Right: Negative `profit_and_loss_reserve` -1296000 with positive `net_assets` 8263000
- Right: One request, $0.0825
- Mistake: Returned `creditors_after_one_year` as 0 for the current year where other absent lines are `null`; the field is not scored for this case

### tier3-05959188

**Tool calling: passed.** Returned Tribe Payments' group and parent company balance sheets for both periods in one `accounts` call. Passed on the first request. ($0.091, 1 requests, 5 s)
- Right: Kept group and parent figures apart, e.g. `tangible_assets` 379315 for the group against 9602 for the parent
- Right: Parent-only `investments` 2467 and prior 2446, `null` for the group
- Right: Deficits negative on both entities (`net_assets` -13564855 group, -15485891 parent)
- Right: One request, $0.0912

### tier3-09727592

**Tool calling: passed.** Returned Tyk Technologies' group and parent balance sheets for both periods in one `accounts` call. Passed on the first request. ($0.074, 1 requests, 5 s)
- Right: Separated group and parent columns, e.g. `cash` 2720339 group against 2017699 parent
- Right: Caught the sign change in the parent: `net_assets` -1632236 this year against 783514 prior
- Right: Returned prior parent `investments` as 0 as expected
- Right: One request, $0.0742

### tier4-05840865

**Tool calling: passed.** Returned Drishaun Holdings' staff costs and creditors notes for group and parent in one `accounts` call. Passed on the first request. ($0.076, 1 requests, 7 s)
- Right: Mapped note lines to categories and due bands, including parent `finance_leases` split 11658 within and 28174 after one year
- Right: Kept zero rows with a prior amount, e.g. group `bank_loans_and_overdrafts` 0 against prior 10251
- Right: Staff cost totals agree with the components (4716869 + 448675 + 205062 = 5370606)
- Right: One request, $0.076

### tier4-NI626135

**Tool calling: passed.** Returned Diamond Trucks' staff costs and creditors notes for group and parent in one `accounts` call. Passed on the first request. ($0.081, 1 requests, 8 s)
- Right: All eight within-one-year categories and both after-one-year rows correct for each entity
- Right: Kept the after-one-year `bank_loans_and_overdrafts` row at 0 with prior 5836
- Right: Group and parent `amounts_owed_to_group` kept distinct (3668476 against 10067741)
- Right: One request, $0.0809

### tier5-12026946

**Tool calling: passed.** Returned the whole set for The Cambium Group UK Holdings (company details, directors, group and parent balance sheets, group profit and loss, staff costs, creditors) in one `accounts` call. Passed on the first request. ($0.099, 1 requests, 14 s)
- Right: Listed all four directors, including `Mr R Thompson` who resigned on 13 August 2025 but served in the period
- Right: Group loss figures negative (`operating_profit` -4462968, `profit_after_tax` -4873903) with the prior tax credit as -51830
- Right: Parent and group balance sheets kept apart (`net_assets` 39954968 parent against 1427969 group)
- Right: One request, $0.0989, the most expensive case

### tier5-NI037684

**Tool calling: passed.** Returned the whole set for John Mulholland Motors (company details, directors, group and parent statements, staff costs, creditors) in one `accounts` call. Passed on the first request. ($0.079, 1 requests, 10 s)
- Right: Set `accounts_type` to `medium` and `consolidated` to true
- Right: Used the `amounts_owed_to_directors` category for 18372 (prior 5938) rather than folding it into `other`
- Right: Caught near-identical group and parent creditor rows that differ slightly, e.g. prior `other` 103090 group against 102990 parent
- Right: One request, $0.0791
