---
title: "Claude Opus 5 on Pydantic AI Accounting"
description: "Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 90%, code mode 80%; rank 2 of 32."
canonical: https://models.pydantic.dev/models/claude-opus-5/accounting_platform/
---

# Claude Opus 5 on Pydantic AI Accounting

> Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 90%, code mode 80%; rank 2 of 32.
>
> Markdown copy of https://models.pydantic.dev/models/claude-opus-5/accounting_platform/. Index for agents: https://models.pydantic.dev/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://models.pydantic.dev/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: https://models.pydantic.dev/select.md
- Search models by name: `GET https://models.pydantic.dev/api/search?query=<text>`
- List, filter and sort models: `GET https://models.pydantic.dev/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://models.pydantic.dev/api/models/<slug>`
- Any other question about the models: `GET https://models.pydantic.dev/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://models.pydantic.dev/mcp`. More: https://models.pydantic.dev/usage.md

About the benchmark: https://models.pydantic.dev/benchmarks/accounting_platform.md. The model on every Pydantic AI benchmark: https://models.pydantic.dev/models/claude-opus-5.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 90%   | 9 of 10      | $9.94 | 73       | 558        | 18.7 min |
| Code mode    | 80%   | 8 of 10      | $1.62 | 85       | 75         | 5.0 min  |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

`gateway/anthropic:claude-opus-5` passed **17/20 runs** on `accounting_platform 0.3`: **9/10 tools** and **8/10 code_mode**. All three failures were broad invoice audits; none was a provider failure. These results support its use for targeted accounting tasks more strongly than for exhaustive anomaly detection.

#### Where it does well

Both modes passed all payment, correction, invoice-total, outstanding-debt and tutor-margin cases: **12/12 runs**. Payment allocation correctly deducted prior allocations and applied new money oldest due date first. Corrections correctly sequenced attendance updates, voiding and replacement invoicing, including released credit.

The explicitly requested duplicate-line and missed-attendance searches also passed **4/4 runs**. Code mode handled large joins systematically: its missed-billing search checked `384` invoices against attendance for `2655` referenced lessons and reported zero missing matches. All four margin answers were correct, although one required an intermediate repair.

#### Mistakes it makes

Broad audits passed only **1/4 runs**. The large tools audit inspected eight invoice details and returned only **3/12** anomalies. Code mode retrieved the full evidence but omitted duplicate-pair checks, returning **9/12** large-audit anomalies and **3/4** small-audit anomalies. Explicit duplicate-search success therefore did not transfer reliably to the broader question.

Code mode also initially omitted tutor pay when no student was charged, then corrected it. Its small invoice audit recognized missed attendance but initially retained the charge in the expected total, fixing the final answer without repairing the calculation. Four successful mutation summaries used pounds despite the integer-pence instruction.

#### Tool calling compared with code mode

Code mode cost **$1.6213**, versus **$9.9375** for tools—about **84% less**—but used **85 requests versus 73** and passed one fewer case. The biggest savings came from retaining bulk records in Python rather than repeatedly exposing them to the model: duplicate detection fell from `$3.0952` to `$0.1716`, and missed billing from `$4.0915` to `$0.2290`.

Code mode added recoverable execution problems: two sandbox rejections of `hasattr`, a missing `is_taxable` field and a nested-call-limit violation. Its lower cost is compelling for bulk work, but complete business-rule checks remain essential.

## Runs

### small-invoice_total-1

**Tool calling: passed.** Passed: retrieved `INV-00084` and returned its tax-inclusive total of `89700` pence. ($0.044, 2 requests, 6 s)
- Right: One `get_invoice` call supplied `net=74752`, `tax=14948` and `total=89700`; the final answer used integer pence.
- Right: Completed in two requests without unnecessary lookups.

**Code mode: passed.** Passed: returned `89700` pence after fetching `INV-00084` and summing its line totals. ($0.053, 3 requests, 7 s)
- Right: `sum(l['total'] for l in inv['lines'])` returned the correct tax-inclusive total.
- Right: The final output used the required integer-pence format.
- Mistake: Used a second `run_code` request to sum lines even though `get_invoice` already returned `total=89700`, increasing requests from two in tools mode to three.

### small-owed_on_invoices-1

**Tool calling: passed.** Passed: returned `85204` pence outstanding on Emeka Brown’s unpaid invoices. ($0.053, 4 requests, 11 s)
- Right: Resolved `CL-0007`, retrieved its two unpaid invoices and checked allocations.
- Right: Correctly calculated `39452 + 49315 - 3563 = 85204`, including the credit allocation whose `payment_id` was null.

**Code mode: passed.** Passed: returned `85204` pence outstanding for Emeka Brown. ($0.053, 3 requests, 6 s)
- Right: Retrieved unpaid invoices and allocations in one `run_code` request after resolving `CL-0007`.
- Right: Correctly deducted the `3563` credit allocation from invoice totals of `39452` and `49315`.

### large-tutor_margin-3

**Tool calling: passed.** Passed: returned `120741` pence for Chen Mensah’s October margin. ($0.32, 5 requests, 76 s)
- Right: Resolved `TU-002`, retrieved `75` October lessons and requested attendance for the `67` billable lessons in two batches.
- Right: Retrieved taxability for `CL-0097`, `CL-0065` and `CL-0269` before returning the correct margin.

**Code mode: passed.** Passed: calculated `360316 - 239575 = 120741` pence for Chen Mensah’s October margin. ($0.15, 6 requests, 21 s)
- Right: Filtered `75` lessons to `67` billable lessons, fetched `79` attendance records and checked `18` clients.
- Right: Used `Decimal` with `ROUND_HALF_UP`, charged only eligible students, split costs by charged-student count and extracted tax from gross prices.
- Right: Calculated tutor pay outside the charged-student loop, once per billable lesson.
- Mistake: Printed the full lesson response and fetched every attendance client’s taxability, although taxability only changes net revenue for gross-priced lessons. The tools run needed three client lookups.

### small-tutor_margin-3

**Tool calling: passed.** Passed: returned `65045` pence for Kai Iyer’s October margin. ($0.19, 5 requests, 39 s)
- Right: Retrieved `39` lessons for `TU-001`, attendance for `37` billable lessons and all seven relevant client records.
- Right: Obtained the correct result despite four billable lessons having no charged student, for which tutor pay still applies.

**Code mode: passed.** Passed after correcting an intermediate tutor-pay omission: revised the margin from `76533` to `65045` pence. ($0.15, 10 requests, 31 s)
- Right: Used `Decimal` and `ROUND_HALF_UP` for student charges, gross tax extraction and tutor pay.
- Right: Identified four billable lessons with no charged students and added their `11488` tutor cost, producing `187435 - 122390 = 65045`.
- Mistake: In the first calculation snippet, `if not charged: continue` appeared before tutor-pay accumulation, incorrectly excluding pay for `LS-001419`, `LS-001445`, `LS-001491` and `LS-001541`. Tutor pay should be calculated for every billable lesson regardless of attendance.
- Mistake: After correcting the calculation, called `list_payment_orders`, which was not needed for a margin defined by lesson dates. The run took `10` requests versus five in tools mode.

### large-duplicate_lines-1

**Tool calling: passed.** Passed: inspected all `384` non-void October invoices and returned `INV-06060`, `INV-06073` and `INV-06097`. ($3.10, 11 requests, 3.9 min)
- Right: Fetched all four `list_invoices` pages containing `394` invoices and excluded the `10` void invoices.
- Right: Used `384` calls to `get_invoice` and identified repeated lesson/student pairs: `LS-044150/ST-0461`, `LS-042250/ST-0483` and `LS-044126/ST-0515`.
- Mistake: The exhaustive inspection exposed every invoice’s lines to the model across eight large batches. It was correct but expensive: `11` requests and `$3.0952`, versus `$0.1716` in code mode.

**Code mode: passed.** Passed: checked all `384` non-void invoices with Python and returned the three duplicate-billing invoices. ($0.17, 10 requests, 27 s)
- Right: Fetched all `394` invoice headers, then invoice details in batches of `90`, `90`, `90`, `90` and `24`.
- Right: Used `Counter([(l['lesson_id'], l['student_id']) for l in d['lines']])` and `any(v > 1 for v in c.values())` to detect duplicates.
- Right: Also checked repeated pairs across invoices and found none.
- Mistake: The first `run_code` failed because the sandbox rejected `hasattr` as an unresolved reference. Removed that inspection expression and recovered on the next request.

### large-missed_billed-1

**Tool calling: passed.** Passed: returned the three invoices charging students marked `missed`: `INV-05846`, `INV-06080` and `INV-05821`. ($4.09, 17 requests, 5.8 min)
- Right: Made `30` calls to `list_attendance` covering `2957` September lesson identifiers.
- Right: Confirmed the offending invoice lines with `get_invoice`: `LS-041761/ST-0127`, `LS-043071/ST-0491` and `LS-044224/ST-0088`.
- Mistake: During attendance retrieval, constructed sequential lesson IDs between the retrieved September endpoints instead of retrieving every actual lesson ID. This worked for this dataset but depended on its contiguous identifiers.
- Mistake: The investigation expanded to October lessons, earlier void invoices and replacement invoices, taking `17` requests and `$4.0915`; code mode joined invoice lines directly to attendance for `$0.2290`.

**Code mode: passed.** Passed: joined all non-void October invoice lines to attendance and returned the three correct invoice IDs. ($0.23, 12 requests, 36 s)
- Right: Fetched `384` invoice details and deduplicated their references to `2655` lesson IDs.
- Right: Retrieved attendance in `27` batches and indexed it by `(lesson_id, student_id)`.
- Right: The scan reported `0` missing attendance matches and `3` hits for `status == 'missed'`.
- Mistake: After finding the three hits, used another `run_code` request to print attendance rows already held in memory; this did not change the answer.

### large-wrong_invoices-1

**Tool calling: failed.** Failed: returned only three of the twelve overcharged invoices, correctly identifying the tax overcharges of `1050`, `1150` and `1875` pence. ($0.89, 9 requests, 3.4 min)
- Right: Retrieved all four October invoice pages.
- Right: Correctly reported `INV-05851`, `INV-06016` and `INV-06105`.
- Mistake: After listing invoices, inspected only eight invoice details. The general September `list_lessons` response advertised `30` pages, but it fetched only the first, followed by five targeted lessons and two student-specific queries.
- Mistake: Never called `get_client` to verify taxability; the three correct tax findings were not backed by authoritative client records.
- Mistake: The final answer omitted price errors `INV-05791:600`, `INV-05877:750`, `INV-06017:500`; missed-attendance charges `INV-05821:4875`, `INV-05846:11700`, `INV-06080:4050`; and duplicates `INV-06060:3563`, `INV-06073:4500`, `INV-06097:9900`. It should have audited every non-void invoice against lesson, attendance and client records, including duplicate-pair checks.

**Code mode: failed.** Failed: audited all `384` non-void invoices and found nine correct overcharges, but omitted all three duplicate-line overcharges. ($0.47, 22 requests, 1.5 min)
- Right: Fetched all `2655` referenced lessons, their attendance and `384` client records.
- Right: Correctly implemented billability, chargeable attendance, split pricing, tax exemptions and integer half-up rounding with `(2*num + den)//(2*den)`.
- Right: Recovered from intermediate errors and completed data retrieval rather than abandoning the audit.
- Mistake: The second `run_code` assumed `search_clients` returned `is_taxable`, causing `KeyError: is_taxable`; it should have used `get_client` for that field.
- Mistake: A later snippet attempted `200` nested client calls and hit the `100`-call limit. It recovered by checking cached clients and fetching only the remainder.
- Mistake: In the final audit loop, `for ln in v['lines']` added an expected charge for every existing line without checking repeated `(lesson_id, student_id)` pairs. Consequently `INV-06060:3563`, `INV-06073:4500` and `INV-06097:9900` disappeared from the report. Expected totals should count each eligible pair once.

### small-wrong_invoices-1

**Tool calling: passed.** Passed: found all four overcharged invoices, covering duplicate billing, incorrect tax, incorrect pricing and missed attendance. ($1.13, 9 requests, 2.8 min)
- Right: Fetched all `37` invoice details, all four September lesson pages and attendance in three batches.
- Right: Returned `INV-00158:4050`, `INV-00162:863`, `INV-00172:600` and `INV-00176:6000`.
- Right: Detected the repeated `LS-001226/ST-0016` line on `INV-00158` and checked `CL-0014` with `get_client` to establish its tax exemption.
- Mistake: The exhaustive raw-record workflow cost `$1.1315` for this small audit; it retrieved all `315` September lessons rather than only those referenced by invoices.

**Code mode: failed.** Failed: returned three correct overcharges but missed the `4050`-pence duplicate charge on `INV-00158`. ($0.19, 9 requests, 41 s)
- Right: Fetched all `37` invoice details, `280` referenced lessons, attendance and client taxability.
- Right: Correctly reported `INV-00162:863`, `INV-00172:600` and, after interpreting the attendance evidence, `INV-00176:6000`.
- Mistake: The first snippet failed on sandbox rejection of `hasattr`; the next snippet removed it.
- Mistake: The calculation iterated over existing invoice lines without deduplicating `(lesson_id, student_id)`, counting `LS-001226/ST-0016` twice in the expected total. It should have charged that pair once and reported `INV-00158:4050`.
- Mistake: The audit computed `billable` and `charged` flags but still executed `exp_total += tot` when either was false. It therefore printed a zero overcharge for missed lesson `LS-001346`; the final answer corrected this to `6000` without repairing and rerunning the calculation.

### large-correction-2

**Tool calling: passed.** Passed: changed Yara Baker’s attendance to `missed`, voided `INV-06372`, and created paid replacement `INV-06548` for `17100` pence dated `2026-11-13`. ($0.057, 5 requests, 14 s)
- Right: Called `update_attendance` for `LS-045235` and `ST-0332` before `void_invoice`, then passed only the three remaining lessons to `create_invoice`.
- Right: The changes correctly released the original `22800` allocation, applied `17100` to the replacement, and set its due date to `2026-11-27`.
- Mistake: The final summary used pounds, including `£171.00` and `£57.00`, despite the handbook requiring integer pence.
- Mistake: The opening `search_clients` was redundant: `get_invoice` supplied the client, student and lesson identifiers.

**Code mode: passed.** Passed: performed the attendance correction, void and replacement invoice in the required order, producing the expected changes. ($0.054, 5 requests, 17 s)
- Right: Used `asyncio.gather` for independent initial reads and verified `LS-045235` with `get_lessons` and `list_attendance`.
- Right: Sequentially awaited `update_attendance` and `void_invoice`, then created `INV-06548` for `17100` pence, paid from released credit.
- Mistake: The final summary mixed integer pence with `£228.00`, violating the pence-only output instruction.
- Mistake: The initial `search_clients` duplicated identification already available from `get_invoice`.

### large-record_payment-1

**Tool calling: passed.** Passed: recorded Jane Kelly’s `50126`-pence payment and allocated it oldest due date first, clearing `INV-02840` and part-paying `INV-03247`. ($0.070, 6 requests, 20 s)
- Right: Used `list_invoices(status="unpaid")` and `list_allocations` to account for the existing `21152` allocation against the `58778` invoice.
- Right: `record_payment` allocated `58778 - 21152 = 37626` to `INV-02840` and the remaining `12500` to `INV-03247`, leaving `12504` outstanding.
- Mistake: The final summary described the payment as `£501.26` instead of integer pence.
- Mistake: `get_settings` did not contribute to the payment allocation calculation.

**Code mode: passed.** Passed: recorded `50126` pence for `CL-0294`, allocating `37626` and `12500` to the correct invoices. ($0.092, 5 requests, 20 s)
- Right: Read invoices and allocations together with `asyncio.gather`, then called `record_payment` dated `2026-11-13`.
- Right: A subsequent unpaid-invoice query confirmed that `INV-02840` had cleared while `INV-03247` remained unpaid.
- Mistake: Retrieved all `18` client invoices, including paid and void records, when an unpaid filter would have sufficed; `get_settings` was also unnecessary.
- Mistake: The final summary expressed every monetary amount in pounds rather than integer pence.
