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

# GPT-6.1 Terra on Pydantic AI - Billing ops

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

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time    |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | ------- |
| Tool calling | 70%   | 7 of 10      | $0.32 | 46       | 169        | 3.2 min |
| Code mode    | 80%   | 8 of 10      | $0.15 | 74       | 74         | 3.6 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

`gpt-6.1-terra` passed 15 of 20 runs: 7/10 with tool calling ($0.32 total) and 8/10 in code mode ($0.15 total). Lookups, the two write tasks and both margin calculations were correct in both modes. All five failures are audit questions over a month of invoices.

#### Where it does well

- **Write tasks (4/4).** `large-correction-2` ran `update_attendance` → `void_invoice` → `create_invoice` in the right order, dated `2026-11-13`. `large-record_payment-1` netted the existing 21152 allocation before applying 37626 and 12500, oldest due first.
- **Margin (4/4).** Per-student half-up rounding, split charges, gross tax and tutor pay on lessons with no charged student were all handled. Tool calling fetched only the three clients on gross lessons.
- **Small lookups (4/4)** in 2–4 requests.
- Reads are issued in parallel in both modes.

#### Mistakes it makes

- **Gives up on large sweeps in tool calling (3 failures).** With 384 non-void invoices it read about 40 (`large-duplicate_lines-1`), 11 (`large-missed_billed-1`) and 6 (`large-wrong_invoices-1`), stopped after 5–6 requests, and submitted an empty or partial answer. Its text admitted the check was incomplete, but the structured result does not carry that caveat.
- **No duplicate-line check in the invoice audit (2 failures, code mode).** Both `wrong_invoices` runs recompute each line on its own, so a student billed twice for one lesson passes. The large run missed exactly the three duplicate-line invoices. In both runs its notes raised unconsidered lines, then it submitted anyway.
- **Unverified mental arithmetic** in the tool-calling margin runs (37 and 67 lessons). Both were right.
- Two tool-calling runs fetched a September `list_lessons` page they never used.

#### Tool calling compared with code mode

Code mode is the better choice for anything large. It completed the full 384-invoice sweep in `large-duplicate_lines-1` and `large-missed_billed-1` for $0.018 and $0.024, where tool calling spent $0.069 and $0.062 and failed. Results stay in the sandbox, so context stays small.

Code mode's costs:

- More requests on small tasks (for example 6 against 4 on `large-record_payment-1`).
- A repeated stumble on the 100 nested-call limit in all three large sweeps. It recovered each time from partial state.

Tool calling won one case: on `small-wrong_invoices-1` it read every invoice and found all four rows, where code mode's per-line check missed `INV-00158`. That was the most expensive run of the set at $0.074.

## Runs

### small-invoice_total-1

**Tool calling: passed.** One `get_invoice` call for `INV-00084` and returned its `total` of 89700. Passed in 2 requests. ($0.0043, 2 requests, 3 s)
- Right: Minimal: one lookup, one answer

**Code mode: passed.** One `run_code` call wrapping `get_invoice` and returned 89700. Passed in 2 requests. ($0.0058, 2 requests, 3 s)
- Right: Minimal

### small-owed_on_invoices-1

**Tool calling: passed.** Found `CL-0007`, read unpaid invoices and allocations in parallel, and returned 39452 + 49315 − 3563 = 85204. Passed in 3 requests. ($0.0047, 3 requests, 5 s)
- Right: Subtracted the 3563 credit allocation on `INV-00155` and ignored allocations on paid invoices

**Code mode: passed.** Found the client, gathered unpaid invoices and allocations, and computed totals less unreleased allocations on those invoices in code: 85204. Passed in 4 requests. ($0.0030, 4 requests, 11 s)
- Right: The expression filters on `released_on is None` and on the unpaid invoice ids

### large-tutor_margin-3

**Tool calling: passed.** Got tutor `TU-002` and settings, `list_lessons` for October, one `list_attendance` over all lesson ids, `get_client` for three clients, and answered 120741. Passed in 5 requests. ($0.021, 5 requests, 24 s)
- Right: Only fetched `get_client` for `CL-0097`, `CL-0065`, `CL-0269`, the clients on gross-priced lessons where `is_taxable` matters
- Right: Correct margin over 67 billable lessons including four with no charged student that still pay the tutor
- Mistake: All the arithmetic over 67 lessons and 79 attendance rows was done without a tool; it came out right but nothing in the run checks it

**Code mode: passed.** Fetched lessons and attendance for `TU-002`, looked up the three clients on gross lessons, and computed revenue 360316 − pay 239575 = 120741 with `Decimal` and `ROUND_HALF_UP`. Passed in 7 requests. ($0.016, 7 requests, 17 s)
- Right: Half-up rounding done with `Decimal.quantize`, per student
- Right: Printed the four lessons with no charged student as a sanity check
- Mistake: Hard-coded the tax as `D(20)/D(120)` instead of using the `tax_rate_percent` it had fetched; harmless here

### small-tutor_margin-3

**Tool calling: passed.** Same route as the large margin case for tutor `TU-001`: lessons, attendance, three `get_client` calls, answer 65045. Passed in 5 requests. ($0.012, 5 requests, 18 s)
- Right: Only looked up `CL-0037`, `CL-0002`, `CL-0008`, the clients on gross-priced lessons
- Right: Counted tutor pay on lessons where every student was `missed`
- Mistake: Arithmetic over 37 lessons done without a tool; correct, but unverified

**Code mode: passed.** Fetched lessons, attendance and clients for `TU-001` and computed revenue 187435 − pay 122390 = 65045 in code. Passed in 6 requests. ($0.013, 6 requests, 17 s)
- Right: Used `settings['tax_rate_percent']` and `Decimal` half-up rounding
- Right: Returned a per-lesson breakdown of 37 lessons for checking
- Mistake: Fetched every client on the attendance list rather than only those on gross lessons; minor

### large-duplicate_lines-1

**Tool calling: failed.** Listed all 4 pages of October invoices (394, 384 non-void), fetched `get_invoice` for only about 40 of them in two turns, then returned `{"ids": []}` while saying the other 344 were unchecked. Failed. ($0.069, 5 requests, 27 s)
- Right: Paginated `list_invoices` fully (pages 2-4 in parallel)
- Right: Was honest in its text that the list was incomplete
- Mistake: After the second batch of `get_invoice` calls (message 7) it stopped at 5 requests with 344 invoices unread; it should have kept issuing parallel `get_invoice` batches until all 384 were covered
- Mistake: The second batch was a scattered pick (`INV-05884`, `INV-05824`, `INV-05950`...) rather than a systematic sweep, so none of `INV-06060`, `INV-06073`, `INV-06097` was read
- Mistake: Submitted an empty `ids` list as a final answer despite knowing it was unverified

**Code mode: passed.** Paged the 394 invoices, fetched all 384 non-void ones with `get_invoice` in batches, and counted `(student_id, lesson_id)` pairs with a `Counter`. Returned the three correct ids. Passed in 9 requests. ($0.018, 9 requests, 24 s)
- Right: Checked duplicates both within an invoice and across invoices
- Right: Recovered from the nested-call limit using the 100 invoices already held in `invs`
- Mistake: Message 5: a loop of `asyncio.gather` batches of 50 inside one `run_code` asked for 384 tool calls and hit the 100-call limit; it then needed four more calls of 100 each

### large-missed_billed-1

**Tool calling: failed.** Listed the October invoices and one page of September lessons, read only the ten reissued invoices from `INV-06145` onward plus `INV-05761`, checked their attendance, and returned an empty list. Failed. ($0.062, 5 requests, 23 s)
- Right: Paginated `list_invoices` fully
- Right: Stated in text that the remaining invoices were unchecked
- Mistake: Message 5: fetched `get_invoice` for only 11 of 384 non-void invoices, then one `list_attendance` call, and stopped at 5 requests
- Mistake: The `list_lessons` call for September page 1 (about 20KB of the 64KB response turn) was never used
- Mistake: Should have read every invoice's lines and batched `list_attendance` over all lesson ids to find lines whose student is `missed`; instead returned `{"ids": []}`, missing `INV-05821`, `INV-05846`, `INV-06080`

**Code mode: passed.** Fetched all 384 non-void invoices, 2655 lesson ids of attendance in 27 batches, and matched invoice lines against the set of `missed` `(lesson_id, student_id)` pairs. Returned the three correct ids. Passed in 11 requests. ($0.024, 11 requests, 27 s)
- Right: Complete sweep: every invoice line checked against attendance
- Right: Kept output small by returning only counts and the three matches
- Mistake: Message 5: same 100 nested-call limit error from looping batches of 80 in one `run_code`; it then fetched in five separate calls of 80

### large-wrong_invoices-1

**Tool calling: failed.** Listed the 394 October invoices, then opened only six (`INV-05851`, `INV-06016`, `INV-06105`, `INV-05821`, `INV-06021`, `INV-05834`) and reported the three non-taxable-client tax overcharges. Failed with 3 of 12 rows. ($0.060, 6 requests, 28 s)
- Right: The three rows it gave (1050, 1150, 1875) are correct
- Right: Verified those three with `get_client`, `get_lessons` and `list_attendance`
- Right: Said in text the list might not be exhaustive
- Mistake: Message 5 onwards: never read the lines of the other 378 invoices, so the wrong-rate, missed-student and duplicate-line invoices were not found
- Mistake: It opened `INV-05821` in message 7 (expected overcharge 4875, a `missed` student) but the attendance calls in message 9 covered only the lessons of the three invoices already found, so it was not reported
- Mistake: Unused `list_lessons` page for September, same as in `large-missed_billed-1`
- Mistake: Stopped at 6 requests instead of sweeping all invoices

**Code mode: failed.** Fetched all 384 invoices, 2655 lessons, 3148 attendance rows and 384 clients, recomputed each line's total and reported 9 invoices. Failed: the three duplicate-line invoices `INV-06060`, `INV-06073`, `INV-06097` are missing. ($0.031, 16 requests, 52 s)
- Right: All nine rows returned have the correct amounts
- Right: Recalculation covers rate, split count, `missed` students and non-taxable clients
- Mistake: Message 29: `correct_line` compares each line's `total` with its recomputed value one line at a time, so a line that appears twice for the same student and lesson passes both times. It needed a check for repeated `(lesson_id, student_id)` pairs, with the extra line counted as overcharge
- Mistake: Message 31: its note mentions lines that were not considered, then it submitted without checking
- Mistake: Message 5: hit the 100 nested-call limit again; 16 requests in total

### small-wrong_invoices-1

**Tool calling: passed.** Listed the October invoices, fetched every one with parallel `get_invoice` calls in one turn, then checked suspect lessons and all September attendance, and returned the four correct rows. Passed in 5 requests. ($0.074, 5 requests, 40 s)
- Right: Read every invoice's lines, which is what the large version of this case did not do
- Right: Found all four error types' invoices including `INV-00158` (4050), which code mode missed
- Mistake: Most expensive run of the set at $0.0743: about 135KB of records pulled into context, including a full September `list_lessons` page and a `list_attendance` call over roughly 280 lesson ids

**Code mode: failed.** Fetched all October invoices, 280 lessons, 331 attendance rows and the clients, recomputed each line and reported three invoices. Failed: `INV-00158` (4050) is missing. ($0.019, 6 requests, 32 s)
- Right: The three rows returned (863, 600, 6000) are correct
- Right: Inspected the lesson, attendance and client behind each difference before answering
- Mistake: Message 7: the same per-line comparison as the large case, with no check for repeated `(lesson_id, student_id)` lines. The large case shows it is duplicate-line invoices this check misses, so that is the likely reason `INV-00158` was not flagged
- Mistake: Message 9: its note says to check for additional lines charged, but the code it ran only printed the three differences already found
- Mistake: Message 3: void invoices were not filtered out of `inv['items']` before checking

### large-correction-2

**Tool calling: passed.** Looked up the client, invoice, settings, lessons, attendance and allocations, then ran `update_attendance` → `void_invoice` → `create_invoice` with the three remaining lessons, all dated `2026-11-13`. Passed in 6 requests. ($0.0062, 6 requests, 15 s)
- Right: Parallel read calls in two turns (`search_clients`, `get_invoice`, `get_settings`; then `get_lessons`, `list_attendance`, `list_allocations`)
- Right: Correct order of writes: attendance to `missed` on `LS-045235`, void `INV-06372`, reissue as `INV-06548` for 17100
- Right: Summary correctly notes the new invoice was paid from credit, leaving 5700 unallocated

**Code mode: passed.** Same three writes as tool calling, each in its own `run_code` call: `update_attendance`, `void_invoice`, `create_invoice`, then a read-back of allocations and ledger. Passed in 7 requests. ($0.015, 7 requests, 20 s)
- Right: Reads gathered with `asyncio.gather`
- Right: Verified the result afterwards: saw allocation 7965 released on `2026-11-13` and 17100 applied to `INV-06548`
- Mistake: The verification call pulled the client's whole ledger (35 entries) and all 21 allocations, which is why it cost $0.0146 against $0.0062 for tool calling

### large-record_payment-1

**Tool calling: passed.** Found `CL-0294`, read unpaid invoices and allocations in parallel, and called `record_payment` for 50126 with allocations 37626 to `INV-02840` and 12500 to `INV-03247`. Passed in 4 requests. ($0.0067, 4 requests, 10 s)
- Right: Subtracted the existing 21152 allocation on `INV-02840` (58778 − 21152 = 37626) before allocating
- Right: Oldest-due-first order followed; remainder went to `INV-03247`
- Right: Converted £501.26 to `50126` and dated it `2026-11-13`

**Code mode: passed.** Looked up the client, unpaid invoices and allocations, computed the two allocations in a `run_code` call, and recorded the payment. Passed in 6 requests. ($0.0060, 6 requests, 16 s)
- Right: Same correct allocations as tool calling: 37626 to `INV-02840`, 12500 to `INV-03247`
- Mistake: A separate `run_code` call was spent on `58778-21152`, and an unneeded `get_client` call was made
- Mistake: The `final_result` summary dropped the invoice ids and amounts that its own text reply had stated
