---
title: "Claude Opus 5.5 on Pydantic AI - Billing ops"
description: "Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 90%, code mode 100%; rank 4 of 44."
canonical: https://pydantic.dev/models/list/claude-opus-5.5/billing_ops/
---

# Claude Opus 5.5 on Pydantic AI - Billing ops

> Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 90%, code mode 100%; rank 4 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/claude-opus-5.5/billing_ops/. 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/billing_ops.md. The model on every Pydantic AI benchmark: https://pydantic.dev/models/list/claude-opus-5.5/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 90%   | 9 of 10      | $6.60 | 100      | 517        | 10.1 min |
| Code mode    | 100%  | 10 of 10     | $0.65 | 58       | 58         | 3.0 min  |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

Opus 5.5 passed 19 of 20 cases: 9 of 10 in tool calling and 10 of 10 in code mode. The one failure was `large-wrong_invoices-1` in tool calling, where it found 3 of the 12 overcharged invoices.

#### Where it does well

- **Changes to the books:** both modes got the void-and-reissue correction (`large-correction-2`) and the payment allocation (`large-record_payment-1`) exactly right. That covers releasing allocation LE-013390, re-invoicing at 17100 and paying it from credit, and splitting the payment 37626/12500 oldest due date first. In both payment runs it checked an earlier same-day payment (56252) before deciding this one was not a duplicate.
- **Single-figure questions:** invoice total, amount owed and both tutor-margin cases were exact in 2–5 requests.
- **Line-level checks with code:** in code mode it recomputed every invoice and found all 12 overcharges in `large-wrong_invoices-1`.

#### Mistakes it makes

- **Stopping early on big audits (1 case):** in tool calling on `large-wrong_invoices-1`, it read the 394-invoice list, opened only 3 invoices whose header figures looked wrong, and answered. It never priced lines from lessons and attendance, so it missed 9 invoices, including INV-05846 (11700) and INV-06097 (9900).
- **Brute force in tool calling (3 cases):** `large-duplicate_lines-1` called `get_invoice` on almost every invoice (20 requests, $2.45). `large-missed_billed-1` paged `list_attendance` across months (37 requests, $2.85). Both still passed.
- **Small code slip:** the first pagination loop in code mode looked for `next_page`/`has_more` keys, but the response returns `page`/`pages`. It fetched 100 of 394 invoices at first, then recovered.

#### Tool calling compared with code mode

Code mode was as accurate or better in every case, and much cheaper on the large data-scanning tasks:

| Case                      | Tool calling | Code mode |
| ------------------------- | ------------ | --------- |
| `large-duplicate_lines-1` | $2.45        | $0.05     |
| `large-missed_billed-1`   | $2.85        | $0.07     |
| `small-wrong_invoices-1`  | $0.74        | $0.09     |

Total cost was about $6.60 for tool calling and $0.65 for code mode. On simple lookups and the two change tasks the modes were similar (2–5 requests each). Where a task needs a join across hundreds of records, tool calling either costs a lot or, as in `large-wrong_invoices-1`, takes a shortcut and gets it wrong. Code mode handled those joins cheaply and completely.

## Runs

### small-invoice_total-1

**Tool calling: passed.** Got 89700 in 2 requests. Passed. ($0.036, 2 requests, 5 s)
- Right: Minimal calls

**Code mode: passed.** Got 89700 in 3 requests. Passed. ($0.039, 3 requests, 4 s)
- Right: Correct

### small-owed_on_invoices-1

**Tool calling: passed.** Got 85204 in 3 requests. Passed. ($0.013, 3 requests, 5 s)
- Right: Correct total less allocations

**Code mode: passed.** Got 85204 in 2 requests. Passed. ($0.013, 2 requests, 4 s)
- Right: Correct

### large-tutor_margin-3

**Tool calling: passed.** Worked out the margin as 120741 in 5 requests. Passed. ($0.14, 5 requests, 28 s)
- Right: Exact figure

**Code mode: passed.** Got 120741 in 4 requests. Passed. ($0.036, 4 requests, 13 s)
- Right: Exact figure

### small-tutor_margin-3

**Tool calling: passed.** Got 65045 in 5 requests. Passed. ($0.084, 5 requests, 18 s)
- Right: Exact figure

**Code mode: passed.** Got 65045 in 3 requests. Passed. ($0.031, 3 requests, 11 s)
- Right: Correct

### large-duplicate_lines-1

**Tool calling: passed.** Read all 4 pages of `list_invoices` for October, then called `get_invoice` on almost every one of the 394 invoices in big parallel batches (20 requests, 40 messages). Found INV-06060, INV-06073 and INV-06097. Passed. ($2.45, 20 requests, 3.2 min)
- Right: Correct set of 3 invoices with duplicate lines
- Right: Batched the `get_invoice` calls in parallel
- Mistake: Brute-force `get_invoice` over hundreds of invoices cost $2.45, about 48× the code-mode run ($0.05)

**Code mode: passed.** Scanned the invoice lines in Python and returned the 3 correct invoices in 7 requests ($0.05). Passed. ($0.051, 7 requests, 16 s)
- Right: Efficient scan done in the sandbox

### large-missed_billed-1

**Tool calling: passed.** Listed October invoices, then pulled `list_lessons` and `list_attendance` in long batches of lesson IDs (37 requests, 74 messages) to match `missed` students against invoice lines. Found the 3 correct invoices. Passed. ($2.85, 37 requests, 3.7 min)
- Right: Correct IDs INV-05821, INV-05846 and INV-06080
- Mistake: Very expensive at $2.85 and 37 requests; code mode needed 7 requests and $0.07

**Code mode: passed.** Joined attendance to invoice lines in code and found the 3 correct invoices in 7 requests. Passed. ($0.071, 7 requests, 16 s)
- Right: Cheap and complete

### large-wrong_invoices-1

**Tool calling: failed.** Read 4 pages of October invoices, then opened only INV-05851, INV-06016 and INV-06105 with their clients (`get_invoice`/`get_client`) and answered with those 3. The expected answer has 12 invoices. ($0.22, 5 requests, 24 s)
- Right: The 3 overcharges it reported (1050, 1150, 1875) are all correct
- Mistake: After the invoice list (message 3), it chose suspects from header-level figures alone and never priced lines from lessons, attendance and charge types. So it missed 9 invoices whose errors are only visible at line level, such as INV-05846 (11700) and INV-06097 (9900)
- Mistake: It stopped after 5 requests without checking its answer against the lesson records

**Code mode: passed.** Recomputed every October invoice in code over 17 requests ($0.22) and returned all 12 overcharged invoices with exact amounts. Passed. ($0.22, 17 requests, 64 s)
- Right: Full line-level recompute found all 12, including the ones that look fine at header level
- Mistake: Its first cell's pagination loop checked for `next_page`/`has_more` keys, but the response returns `page`/`pages`, so it fetched only 100 of 394 invoices at first; it printed the metadata and recovered later

### small-wrong_invoices-1

**Tool calling: passed.** Recomputed the invoices over 13 requests ($0.74) and found all 4 wrong invoices with the right overcharges. Passed. ($0.74, 13 requests, 86 s)
- Right: Full line-level check on the small dataset
- Mistake: About 8× the cost of code mode ($0.09)

**Code mode: passed.** Found all 4 wrong invoices with the right overcharges in 6 requests. Passed. ($0.088, 6 requests, 25 s)
- Right: Correct and cheap

### large-correction-2

**Tool calling: passed.** Marked ST-0332 as `missed` on LS-045235, voided INV-06372 with a 22800 credit note that released allocation LE-013390, then re-invoiced the other three October lessons at 17100, which was paid from credit. All in 5 requests. Passed. ($0.032, 5 requests, 13 s)
- Right: Void, credit note, release and re-invoice were done in the order the handbook gives
- Right: New invoice of 14250 net + 2850 tax was paid from the released credit

**Code mode: passed.** Made the same correct sequence of void, credit note and re-invoice in 4 requests. Passed. ($0.053, 4 requests, 12 s)
- Right: Same exact changes as the tools run

### large-record_payment-1

**Tool calling: passed.** Recorded a 50126 payment for CL-0294 and allocated it oldest due date first: 37626 to INV-02840 (now paid) and 12500 to INV-03247. Passed. ($0.043, 5 requests, 12 s)
- Right: Checked whether it duplicated an earlier payment that day (56252) and correctly treated it as a separate payment
- Right: Allocation order and amounts are correct

**Code mode: passed.** Recorded the 50126 payment and allocated 37626 and 12500 oldest due date first. Passed. ($0.051, 5 requests, 13 s)
- Right: Correct allocation, plus the same check against the earlier 56252 payment
