---
title: "GPT-5.6 Terra on Pydantic AI - Billing ops"
description: "Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 50%, code mode 80%; rank 36 of 44."
canonical: https://pydantic.dev/models/list/gpt-5.6-terra/billing_ops/
---

# GPT-5.6 Terra on Pydantic AI - Billing ops

> Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 50%, code mode 80%; rank 36 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/gpt-5.6-terra/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/gpt-5.6-terra/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time    |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | ------- |
| Tool calling | 50%   | 5 of 10      | $1.45 | 44       | 388        | 3.3 min |
| Code mode    | 80%   | 8 of 10      | $0.39 | 73       | 73         | 3.3 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

gpt-5.6-terra passed 6 of 10 cases in tool mode and 8 of 10 in code mode. Both modes passed all the small lookups and both write tasks: `large-correction-2` and `large-record_payment-1`. The failures were all on audit-style questions that need many records cross-checked: duplicate lines, missed students who were billed, wrong invoices, and one margin.

#### Where it does well

- **Write tasks:** in both modes, the void, re-invoice, credit-release and payment-allocation chains matched every expected row.
- **Code pricing:** in code mode it priced lines correctly, with `Decimal` and `ROUND_HALF_UP`, split division and net/gross tax. All 9 amounts it reported in `large-wrong_invoices-1` were exact.
- **Fixing its own code:** in `small-wrong_invoices-1` it noticed that the attendance dict was being overwritten and fixed it.

#### Mistakes it makes

- **Gave up in tool mode on large data (3 cases):** in `large-duplicate_lines-1`, `large-missed_billed-1` and `large-wrong_invoices-1` it called `final_result` with an empty list. It called the job of fetching about 384 invoices 'impractical' or 'cognitively overwhelming'. Two of these runs were also the most expensive ($0.42 and $0.65).
- **Partial checking (1 case):** in `small-wrong_invoices-1` (tools) it checked attendance only for lines that looked suspicious, so it missed `INV-00176`.
- **Mental arithmetic (1 case):** in `small-tutor_margin-3` (tools) it hand-summed 37 lessons and came out 3668 pence low (61377 against 65045).
- **Incomplete audit logic in code (2 cases):** the recomputation compared each existing line with its own value, so duplicate (lesson, student) lines always passed. In the small case it also didn't check each line's own student status.

#### Tool calling compared with code mode

Code mode fixed every failure that came from scale or arithmetic. `large-duplicate_lines-1`, `large-missed_billed-1` and `small-tutor_margin-3` passed with code, and the large ones cost far less ($0.05–0.07 against $0.12–0.42). In `large-wrong_invoices-1`, code mode found 9 of 12 invoices where tool mode found none. Code mode's remaining failures came from gaps in the checking logic, not from missing data. It used more requests (up to 18 against 5), but those requests cost less in total on the large cases.

## Runs

### small-invoice_total-1

**Tool calling: passed.** Got the answer, 89700, in 2 requests. ($0.0094, 2 requests, 6 s)
- Right: Minimal calls

**Code mode: passed.** Returned 89700, which is correct, in 2 requests. ($0.013, 2 requests, 3 s)
- Right: Minimal calls

### small-owed_on_invoices-1

**Tool calling: passed.** Returned 85204, which is correct, in 4 requests. ($0.0062, 4 requests, 8 s)
- Right: Correct outstanding amount, net of allocations

**Code mode: passed.** Returned 85204, which is correct. ($0.0076, 4 requests, 9 s)
- Right: Correct, 4 requests

### large-tutor_margin-3

**Tool calling: passed.** Pulled the tutor's lessons, attendance, settings and clients, and returned 120741, which is correct. ($0.062, 5 requests, 25 s)
- Right: Exact margin, with no code

**Code mode: passed.** Worked out the margin in code and returned 120741, which is correct. ($0.040, 6 requests, 16 s)
- Right: Correct, cheaper than tools ($0.040 vs $0.062)

### small-tutor_margin-3

**Tool calling: failed.** Found tutor `TU-001`, 39 October lessons, attendance, settings and 7 clients. It then worked out the margin in its head and answered 61377; the expected answer was 65045. ($0.039, 5 requests, 17 s)
- Right: Collected all the required data: lessons, attendance, tax setting, client taxability
- Right: Correctly excluded the 2 cancelled lessons
- Mistake: Final step: hand-summed 37 lessons of split, tax and tutor-pay figures and came out 3668 pence low. Code mode got the same task right with code.

**Code mode: passed.** Worked out the margin in code and returned 65045, which is correct. ($0.035, 6 requests, 18 s)
- Right: Code arithmetic avoided the error tool mode made on the same case

### large-duplicate_lines-1

**Tool calling: failed.** Listed the 384 October invoices, then fetched `get_invoice` in batches of about 35, 100 and 100. It never fetched the rest, including `INV-06060` and `INV-06097`, and answered `{"ids": []}`. ($0.42, 5 requests, 40 s)
- Right: Correctly split the listing by `paid` and `unpaid` to leave out void invoices
- Mistake: Messages 5–7: fetched only about 238 of the 384 invoices, then called `final_result` with an empty list instead of fetching the remaining invoices
- Mistake: Its reasoning called the full scan 'cognitively overwhelming', and it gave up without checking every invoice; cost $0.42

**Code mode: passed.** Fetched every October invoice with `asyncio.gather`, grouped lines by (lesson, student) and returned `INV-06060`, `INV-06073` and `INV-06097`, which is correct. ($0.052, 8 requests, 23 s)
- Right: Checked all 384 invoices programmatically for $0.05, against $0.42 for the failed tool run

### large-missed_billed-1

**Tool calling: failed.** Listed October invoices and the September `complete` and `cancelled_chargeable` lessons. It decided that fetching about 384 invoices was 'impractical', called no `get_invoice` and no `list_attendance`, and returned `{"ids": []}`. ($0.12, 4 requests, 22 s)
- Right: Correctly reasoned that October invoices cover September lessons
- Mistake: Message 7: gave up and returned an empty list without reading any invoice lines or attendance; it should have fetched invoice details and attendance and compared each line with the student's status

**Code mode: passed.** Joined invoice lines to attendance in code over 13 requests and returned the three expected invoices. ($0.068, 13 requests, 34 s)
- Right: Complete scan instead of giving up
- Mistake: 13 requests, some of them retrying batched fetches; this was wasteful but not harmful

### large-wrong_invoices-1

**Tool calling: failed.** Listed 4 pages of invoices, `get_settings`, and about 29 pages of September lessons. It then returned `{"rows": []}` without fetching any invoice lines. ($0.65, 5 requests, 27 s)
- Right: Identified the right data sources (September lessons, attendance)
- Mistake: Message 9: called `final_result` with empty rows after loading the lesson pages, without fetching invoices, attendance or doing any recomputation
- Mistake: Most expensive run: $0.65 for no answer

**Code mode: failed.** Loaded all invoices, lessons, attendance and the 384 clients in batches, recomputing each line with `calc_line`, a function that returns 0 for an uncharged student. It found 9 of 12 invoices but missed the duplicate-line ones: `INV-06060`, `INV-06073` and `INV-06097`. ($0.096, 18 requests, 48 s)
- Right: Correct half-up `Decimal` rounding, split and net/gross handling; all 9 amounts it reported were exact
- Right: Caught the charges for missed students and the tax wrongly charged to non-taxable clients
- Mistake: Message 33: compared each existing line with its own recomputed value, so a duplicate (lesson, student) line passed. It should have charged only once per (lesson, student) and counted the extra lines as overcharge.
- Mistake: Messages 29–31: client batches failed and had to be refetched, which took 18 requests in all

### small-wrong_invoices-1

**Tool calling: failed.** Fetched all 37 invoices, then only checked lessons on the three invoices that looked odd: `LS-001226`, `LS-001133` and `LS-001295`. It found `INV-00158`, `INV-00162` and `INV-00172` but missed `INV-00176` (6000). ($0.083, 4 requests, 19 s)
- Right: Spotted the duplicate on `INV-00158` and the tax charged to a non-taxable client on `INV-00162` by inspection
- Mistake: Message 5: checked attendance only for the lines it suspected, not for every line. So it missed `INV-00176`, a charge that only shows up against attendance.

**Code mode: failed.** Fetched all 37 invoices, 280 lessons and attendance. Its first attempt keyed attendance by `lesson_id` and overwrote students; it noticed and switched to a `defaultdict(list)`. `expected_line` never checked whether the line's student was charged and never caught duplicate lines, so it found only `INV-00162` and `INV-00172`. ($0.044, 6 requests, 19 s)
- Right: Noticed and fixed the attendance dict being overwritten (message 7)
- Right: Correct pricing and tax rules in `expected_line`
- Mistake: Message 9: `expected_line` prices every existing line without checking that student's own status, so it missed `INV-00176`, where a missed student was charged
- Mistake: It doesn't find duplicate (lesson, student) lines, so it missed `INV-00158`, which tool mode found by eye

### large-correction-2

**Tool calling: passed.** Changed Yara Baker's attendance on `LS-045235` to `missed`, voided `INV-06372` and re-invoiced the three remaining lessons (17100, paid from released credit). Every expected change matched. ($0.012, 5 requests, 15 s)
- Right: Full void and re-invoice chain matched exactly, including the released allocation dated 2026-11-13
- Right: Cheap: 5 requests, $0.0115

**Code mode: passed.** Made the same correction as in tool mode: changed the attendance, voided and re-invoiced, and applied credit. Every change matched. ($0.014, 5 requests, 13 s)
- Right: Exact match in 5 requests, $0.0137

### large-record_payment-1

**Tool calling: passed.** Recorded the 50126 payment for CL-0294. The allocations were 37626 to `INV-02840` and 12500 to `INV-03247`, so the first invoice is now paid. ($0.041, 5 requests, 18 s)
- Right: Allocation oldest-due-first matched the expected result exactly

**Code mode: passed.** Recorded the 50126 payment with the correct allocations. ($0.021, 5 requests, 13 s)
- Right: Exact match, $0.0213
