---
title: "Claude Fable 5.2 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-fable-5.2/billing_ops/
---

# Claude Fable 5.2 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-fable-5.2/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-fable-5.2/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost   | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ------ | -------- | ---------- | -------- |
| Tool calling | 90%   | 9 of 10      | $12.68 | 60       | 580        | 13.2 min |
| Code mode    | 100%  | 10 of 10     | $1.58  | 51       | 54         | 3.4 min  |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

Claude Fable 5.2 passed 19 of 20 cases: 9 of 10 in tool calling and 10 of 10 in code mode. The only failure was `large-wrong_invoices-1` in tool calling, where it found 3 of the 12 wrong invoices.

#### Where it does well

- **Writes:** All 4 write cases were exact. These were `correction-2` and `record_payment-1`, each in both modes. In `correction-2` it voided INV-06372, released allocation LE-013390, re-invoiced the three remaining lessons for 17100 and applied the credit straight away. In `record_payment-1` it allocated the payment oldest due first (37626, then 12500). It also flagged an existing payment of 56252 dated the same day and correctly treated the new one as separate.
- **Arithmetic:** Margins (120741 and 65045), the invoice total and the amount owed were exact to the penny in both modes. Its code used integer half-up rounding, `(2*num+den)//(2*den)`.
- **Simple lookups:** These took 2 to 5 requests and usually cost under $0.10.

#### Mistakes it makes

- **Sampling instead of checking everything.** In tool calling on `large-wrong_invoices-1`, it opened only about 6 invoices with `get_invoice`. It then used its remaining requests on `list_lessons` for cancelled and planned September lessons. It caught only the 3 cases of tax charged to non-taxable clients. It missed the duplicate-line and missed-but-billed errors, even though its own `duplicate_lines` and `missed_billed` runs found exactly those invoices. To get them all, it needed to reprice every line of every non-void October invoice, as code mode did.
- **Expensive brute force.** In tool calling, when it did check everything, it pulled in hundreds of `get_invoice` results through about 50 parallel calls per turn. `large-duplicate_lines-1` cost $4.36 and `large-missed_billed-1` cost $4.17.

#### Tool calling compared with code mode

Code mode was more accurate (10/10 against 9/10) and much cheaper: about $1.58 in total, against about $12.68 for tool calling. Both modes used similar numbers of requests, 4 to 9 per case.

On `large-wrong_invoices-1`, code mode used `asyncio.gather` to fetch every invoice, lesson, attendance record and client. It then repriced each line under every rule and got all 12 invoices for $0.29. Tool calling cost $1.30 and got 3.

On the duplicate and missed-billed cases, code mode cost about 20 times less ($0.15 and $0.25 against more than $4) for the same correct answers. Code mode was cheaper on every case except two, which cost about the same: `small-invoice_total` and `large-record_payment` ($0.18 against $0.12). Tool calling was competitive only on small lookups and writes.

## Runs

### small-invoice_total-1

**Tool calling: passed.** It answered in 2 requests with the correct total, 89700. ($0.077, 2 requests, 6 s)
- Right: Minimal calls

**Code mode: passed.** It answered correctly with 89700 in 2 requests. ($0.077, 2 requests, 6 s)
- Right: Minimal

### small-owed_on_invoices-1

**Tool calling: passed.** It summed the unpaid invoice totals less their allocations and got 85204, which was correct. ($0.081, 3 requests, 7 s)
- Right: Correct and cheap: 3 requests

**Code mode: passed.** It answered correctly with 85204 in 2 requests. ($0.035, 2 requests, 6 s)
- Right: Cheapest run, at $0.03

### large-tutor_margin-3

**Tool calling: passed.** It worked out the margin, client net charges less tutor pay, in 5 requests. The answer was correct: 120741. ($0.37, 5 requests, 38 s)
- Right: Exact figure, correct to the penny

**Code mode: passed.** It computed the margin correctly as 120741 in 4 requests. ($0.085, 4 requests, 17 s)
- Right: $0.09 against $0.37 in tools mode

### small-tutor_margin-3

**Tool calling: passed.** It computed the margin correctly as 65045 in 5 requests. ($0.21, 5 requests, 21 s)
- Right: Exact figure

**Code mode: passed.** It answered correctly with 65045 in 4 requests. ($0.095, 4 requests, 16 s)
- Right: Exact

### large-duplicate_lines-1

**Tool calling: passed.** It paged through all October invoices with `list_invoices`, then called `get_invoice` for every one, about 50 parallel calls per turn over roughly 9 turns, and spotted the duplicated lines. It returned the correct 3 IDs. ($4.36, 12 requests, 3.5 min)
- Right: Correct answer: INV-06060, INV-06073, INV-06097
- Right: Batched many parallel calls in each turn
- Mistake: Brute-forced hundreds of invoice detail responses into the context. That cost $4.36, against $0.15 in code mode.

**Code mode: passed.** It fetched the invoices in Python and found the duplicate lines, giving the correct 3 IDs. ($0.15, 6 requests, 21 s)
- Right: Correct, and $0.15 against $4.36 in tools mode

### large-missed_billed-1

**Tool calling: passed.** It fetched invoice details and attendance across 11 requests and found the 3 invoices that bill students marked missed. The answer was correct. ($4.17, 11 requests, 3.6 min)
- Right: Correct set: INV-05821, INV-05846, INV-06080
- Mistake: Same brute-force pattern as duplicate_lines: $4.17, against $0.25 in code mode

**Code mode: passed.** It cross-checked invoice lines against attendance in code and returned the correct 3 IDs. ($0.25, 7 requests, 22 s)
- Right: Correct for $0.25

### large-wrong_invoices-1

**Tool calling: failed.** It listed the October invoices but opened only a handful with `get_invoice` (INV-05761, INV-05851, INV-06016, INV-06105, INV-05811, INV-06146). It then spent its remaining turns listing cancelled and planned September lessons and their attendance. It returned only the 3 invoices that charged tax to non-taxable clients and missed 9 of the 12. ($1.30, 6 requests, 2.1 min)
- Right: The 3 tax errors it found were right: INV-05851 1050, INV-06016 1150, INV-06105 1875
- Mistake: At step 3 it sampled only a few invoices instead of opening every non-void October invoice and repricing each line from the lesson, attendance and client records
- Mistake: Never checked for duplicate lines or for missed students who were billed, so it missed INV-06060, INV-06073, INV-06097, INV-05821, INV-05846 and INV-06080, which its own other runs found
- Mistake: Spent requests 5–9 on `list_lessons` with status `cancelled`/`planned` plus large `list_attendance` calls, then stopped with an incomplete answer

**Code mode: passed.** It fetched every non-void October invoice with `asyncio.gather` over `get_invoice`, plus the lessons, attendance and clients. It then repriced every line with a half-up `rhu` helper covering billable status, missed students, duplicate lines, the split charge types and taxability. It found all 12 invoices with exact amounts. ($0.29, 8 requests, 43 s)
- Right: Systematic repricing of every line instead of guessing which error types to look for
- Right: Integer half-up rounding `(2*num+den)//(2*den)`
- Right: Checked that each invoice's header totals match the sum of its lines
- Mistake: Several fetch batches were split across separate `run_code` calls. Harmless, but some requests were spent just on fetching.

### small-wrong_invoices-1

**Tool calling: passed.** It found all 4 wrong invoices with the correct overcharges, in 6 requests. ($1.90, 6 requests, 2.3 min)
- Right: All 4 IDs and amounts were exact
- Mistake: Costly at $1.90 for the small dataset, against $0.28 in code mode

**Code mode: passed.** It found all 4 wrong invoices with exact amounts, in 9 requests. ($0.28, 9 requests, 42 s)
- Right: Correct, for $0.28
- Mistake: Used 9 requests, more than the 6 it took in tools mode

### large-correction-2

**Tool calling: passed.** It marked ST-0332 as missed on LS-045235, voided INV-06372 (22800) with a credit note and re-invoiced the remaining 3 French lessons as a new invoice of 17100, which the released credit paid. Every change matched the expected diff. ($0.095, 5 requests, 16 s)
- Right: Released allocation LE-013390 on 2026-11-13 and turned it into credit
- Right: Each new line was 4750 net + 950 tax = 5700, and the 17100 credit allocation was applied straight away
- Right: Done in 5 requests for $0.09

**Code mode: passed.** It made the same void, credit-note and re-invoice correction as in tools mode, and it matched the expected diff exactly. ($0.14, 4 requests, 14 s)
- Right: All changes correct in 4 requests

### large-record_payment-1

**Tool calling: passed.** It recorded a payment of 50126 for CL-0294 as LE-013560 and allocated it oldest due first: 37626 to INV-02840, which is now paid, and 12500 to INV-03247. This matched the expected diff. ($0.12, 5 requests, 18 s)
- Right: Correct oldest-due-first allocation, leaving no credit over
- Right: Noticed an existing payment of 56252 dated today and correctly judged that it was not a duplicate

**Code mode: passed.** It recorded the 50126 payment and allocated 37626 to INV-02840 and 12500 to INV-03247. The changes matched the expected diff. ($0.18, 5 requests, 19 s)
- Right: Correct allocation, and it considered the possible duplicate payment
