---
title: "GPT-6.2 Astra 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 100%; rank 21 of 44."
canonical: https://pydantic.dev/models/list/gpt-6.2-astra/billing_ops/
---

# GPT-6.2 Astra on Pydantic AI - Billing ops

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

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time    |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | ------- |
| Tool calling | 70%   | 7 of 10      | $5.52 | 66       | 502        | 3.8 min |
| Code mode    | 100%  | 10 of 10     | $0.65 | 63       | 63         | 3.3 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

`gpt-6.2-astra` passed 17 of 20 runs: 7 of 10 with tool calling and 10 of 10 in code mode. All three failures are audit questions in tool calling, where the model had to check every October invoice against lessons and attendance and checked only a sample.

#### Where it does well

- **Single-record lookups and writes**: `invoice_total`, `owed_on_invoices`, `record_payment` and `correction` passed in both modes in 2 to 5 requests. It subtracted existing allocations, allocated oldest due date first, and ordered attendance change, void and reissue correctly.
- **Margin**: both tutor margin cases were exact in both modes, including by hand over 67 lessons in tool calling.
- **Rule handling in code**: integer half-up rounding via `(2*n+d)//(2*d)`, gross tax as `cost*20/120`, split by charged students only, released allocations ignored.

#### Mistakes it makes

- **Sampling instead of full coverage (3 failures, tool calling)**:
  - `large-wrong_invoices-1` opened 4 of 384 invoices, chosen from odd header tax, and returned 3 of 12 rows with no caveat.
  - `small-wrong_invoices-1` fetched all 37 invoices but looked up only five lessons, so it missed `INV-00176` (6000), whose lines look consistent.
  - `large-missed_billed-1` queried attendance for guessed id ranges `LS-041700` to `LS-041899`, found 1 of 3 and stopped, stating the result was partial.
- **Cost when it did cover everything**: `large-duplicate_lines-1` in tool calling passed with about 380 `get_invoice` calls and cost $4.06.
- **Stray calls**: `list_payment_orders` in both tool-calling margin cases, and `list_invoices` re-queried with `sent_from` `2026-10-02` twice.
- **Code mode slips**: `list_invoices(**q)` with a dict failed type checking in all 4 invoice audit cases, one wasted request each. One run hit the 100 nested-call limit once.

#### Tool calling compared with code mode

Code mode was better on every audit case. It loaded all invoices, lessons and attendance in batches of under 100 calls and recomputed totals, so nothing depended on what the model chose to look at. The four audit cases cost $0.38 in code mode against $5.12 in tool calling. On the six simpler cases the two modes were equal on correctness and within a request of each other. Tool calling was slightly cheaper on the two write cases, while code mode was cheaper on the two margin cases and on `small-owed_on_invoices-1`.

## 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.037, 2 requests, 4 s)
- Right: Minimal path, correct figure

**Code mode: passed.** One `run_code` calling `get_invoice` and returned 89700. Passed in 2 requests. ($0.047, 2 requests, 6 s)
- Right: Minimal path

### small-owed_on_invoices-1

**Tool calling: passed.** Found client `CL-0007`, fetched unpaid invoices and allocations in parallel, and returned 39452 + 49315 − 3563 = 85204. Passed in 3 requests. ($0.040, 3 requests, 9 s)
- Right: Subtracted the 3563 credit allocation on `INV-00155`
- Right: Parallel `list_invoices` and `list_allocations`

**Code mode: passed.** Found the client, listed unpaid invoices, then summed totals less unreleased allocations per invoice in code: 85204. Passed in 4 requests. ($0.022, 4 requests, 10 s)
- Right: Paged `list_allocations` per invoice and excluded released allocations
- Mistake: One more request than tool calling, since the three lookups were done as separate snippets

### large-tutor_margin-3

**Tool calling: passed.** Listed Chen Mensah's 75 October lessons, fetched attendance for the 67 billable ones and worked out 120741 without any calculator. Passed in 5 requests. ($0.15, 5 requests, 22 s)
- Right: Filtered to billable lessons before `list_attendance`
- Right: Only fetched the three clients (`CL-0097`, `CL-0269`, `CL-0065`) whose taxability mattered
- Right: Got the exact figure from 67 lessons of mixed charge types by hand
- Mistake: Request 4: `list_payment_orders` for `TU-002` is not needed by the handbook rule; it looks like a cross-check of the tutor pay total
- Mistake: The whole sum was done unaided over 67 lessons, so the correct result carried arithmetic risk

**Code mode: passed.** Listed lessons, attendance and the clients on gross lessons, then computed revenue 360316 less tutor pay 239575 = 120741 in code. Passed in 6 requests. ($0.053, 6 requests, 17 s)
- Right: Integer half-up rounding with `(2*n+d)//(2*d)` rather than Python's `round`
- Right: Gross tax taken out per line as `cost*20/120`, and only for taxable clients
- Mistake: Did not check `pages` on `list_lessons`; it happened to be 1 of 1 with 75 lessons

### small-tutor_margin-3

**Tool calling: passed.** Listed Kai Iyer's 39 October lessons, fetched attendance for the 37 billable ones and returned 65045. Passed in 5 requests. ($0.087, 5 requests, 18 s)
- Right: Excluded the two `cancelled` lessons and the `missed` students
- Right: Checked taxability only for clients on `gross` lessons (`CL-0037`, `CL-0002`, `CL-0008`)
- Mistake: Request 4: extra `list_payment_orders` call for `TU-001`; `PO-0041` of 122390 matches the tutor pay but the handbook does not need it
- Mistake: All arithmetic done unaided

**Code mode: passed.** Listed 39 lessons, attendance and all attending clients, then computed 187435 − 122390 = 65045 in code. Passed in 6 requests. ($0.044, 6 requests, 18 s)
- Right: Same half-up integer rounding helper and gross-tax handling as the large case
- Mistake: Fetched every client with `get_client`, not just those on gross lessons; harmless at this size

### large-duplicate_lines-1

**Tool calling: passed.** Fetched every October invoice one `get_invoice` call at a time, about 50 per request, and read the lines by eye to find repeats. Correct answer, but it cost $4.06 over 14 requests. ($4.06, 14 requests, 21 s)
- Right: Covered all four pages of invoices and found all three: `INV-06060`, `INV-06073`, `INV-06097`
- Mistake: Request 2: called `list_invoices` again with `sent_from` `2026-10-02`, a wasted probe before paging
- Mistake: Requests 6 to 13: roughly 380 `get_invoice` calls with each batch of results 48k to 74k characters; the conversation reached about 626k characters, which is why this case cost $4.06 against $0.055 in code mode
- Mistake: Request 5: unrelated `list_ledger_entries` call for `2026-10-01` invoices that fed nothing into the answer

**Code mode: passed.** Paged invoices, then ran a `find` helper over four batches of 96 `get_invoice` calls comparing `(student_id, lesson_id)` pairs. Passed in 8 requests for $0.055. ($0.055, 8 requests, 20 s)
- Right: Batches of 96 stayed under the 100 nested calls per `run_code` limit
- Right: Duplicate test was a set comparison in code, with only ids returned to the model
- Mistake: First call failed type checking on `list_invoices(**q)` with a dict; one wasted request

### large-missed_billed-1

**Tool calling: failed.** Sampled a few invoices and two blocks of 100 guessed lesson ids, found one match and returned `INV-05846` alone, saying in its text that the result was partial. Expected three invoices; failed. ($0.38, 11 requests, 62 s)
- Right: Correctly confirmed `INV-05846` via `get_lessons` for `LS-041761` and the `missed` attendance
- Right: Was honest that it had not verified every October invoice
- Mistake: Requests 6 and 9: called `list_attendance` on guessed sequential ids `LS-041700` to `LS-041899` instead of the lesson ids on the invoice lines, so only about 200 of 2,655 lessons were checked
- Mistake: Never fetched lines for most of the 384 invoices: only `INV-05761`, `INV-05846`, `INV-05811`, `INV-06146`, `INV-05817`, `INV-06154` were opened, and pages 2 to 4 of `list_invoices` were never read
- Mistake: Requests 2 and 5: wasted `list_invoices` variants (`sent_from` `2026-10-02`, `status` `unpaid`)
- Mistake: Stopped after 11 requests with a known-partial answer, missing `INV-05821` and `INV-06080`; it should have continued through every invoice's lines and their attendance

**Code mode: passed.** Fetched all 384 non-void invoices in batches of 99, pulled attendance for 2,655 lessons in chunks of 100 and matched `missed` pairs against lines. Passed in 10 requests. ($0.10, 10 requests, 26 s)
- Right: Complete coverage: every invoice line checked against `list_attendance`
- Right: Returned `INV-05821`, `INV-05846`, `INV-06080`
- Mistake: Request 1: the same `list_invoices(**q)` type error
- Mistake: Request 3: 3 page calls plus 99 `get_invoice` calls exceeded the 100 nested-call limit and raised `RuntimeError`; the retry worked because `ids` had already been set

### large-wrong_invoices-1

**Tool calling: failed.** Read the four `list_invoices` pages, opened only the invoices whose header tax looked odd, and returned three rows. Expected twelve; failed. ($0.34, 9 requests, 32 s)
- Right: The three rows it gave (`INV-05851` 1050, `INV-06016` 1150, `INV-06105` 1875) are correct: tax charged on a line for clients with `is_taxable` false
- Right: Paged all four pages of `list_invoices`
- Mistake: Only opened four invoices (`INV-05851`, `INV-06016`, `INV-06105`, `INV-05884`) out of 384, so it only caught errors visible in the header net/tax/total
- Mistake: Never called `get_lessons` or `list_attendance`, so it could not find wrong rates, duplicate lines, or charges for `missed` students; missed nine invoices including `INV-05846` (11700) and `INV-06097` (9900)
- Mistake: Request 7: `list_ledger_entries` and `list_allocations` for `INV-05851` added nothing
- Mistake: Returned the short list with no note that it was incomplete; it should have recomputed every line from lessons and attendance

**Code mode: passed.** Loaded all 384 invoices, 2,655 lessons, attendance and client taxability, recomputed each invoice total and returned all twelve differences. Passed in 12 requests. ($0.11, 12 requests, 42 s)
- Right: Recomputed from lessons and attendance, skipping duplicate lines, non-billable lessons and uncharged students, so every kind of error was caught
- Right: Split divisor used the count of charged students
- Right: All twelve amounts exact
- Mistake: Request 1: `list_invoices(**q)` type error
- Mistake: Six requests were bare `await batch()` or `await cb()` calls to stay under the 100-call limit; a `search_clients(name='')` call returned only 50 clients and was not used

### small-wrong_invoices-1

**Tool calling: failed.** Fetched all 37 October invoices and spot-checked a handful of lessons, returning three of the four wrong invoices. Missed `INV-00176` (6000); failed. ($0.33, 7 requests, 27 s)
- Right: Opened every invoice with `get_invoice` across four requests
- Right: Got `INV-00158` 4050, `INV-00162` 863 and `INV-00172` 600 right
- Mistake: Only looked up lessons that looked odd on the invoice: `LS-001219`, `LS-001063`, `LS-001138`, `LS-001295`, `LS-001133`. `INV-00176` has internally consistent lines (four at 6000, four at 4750, no tax), so nothing flagged it
- Mistake: Never called `list_attendance` or `get_lessons` for the `INV-00176` lessons (`LS-001128`, `LS-001200`, `LS-001273`, `LS-001346`); the 6000 overcharge equals one of those lines
- Mistake: Request 6: `list_lessons` with `status` `cancelled` for September returned 18 lessons, none on `INV-00176`, and it then stopped
- Mistake: Should have fetched lessons and attendance for every line and recomputed each one

**Code mode: passed.** Fetched 37 invoices, their clients, lessons and attendance, recomputed every total and returned all four differences including `INV-00176` 6000. Passed in 6 requests. ($0.10, 6 requests, 23 s)
- Right: Full recomputation caught `INV-00176`, which tool calling missed
- Right: Each amount exact
- Mistake: Request 1: `list_invoices(**q)` type error

### large-correction-2

**Tool calling: passed.** Looked up the invoice and client, set the attendance to `missed`, voided `INV-06372` and reissued the three remaining lessons as `INV-06548` dated 2026-11-13. Passed in 5 requests. ($0.033, 5 requests, 16 s)
- Right: Ran `search_clients` and `get_invoice` in parallel in the first request
- Right: Correct order: `update_attendance` (`LS-045235`, `ST-0332`, `missed`), then `void_invoice` dated `2026-11-13`, then `create_invoice` with the three other lines
- Right: Summary reported the new total of 17100 and that credit paid it in full

**Code mode: passed.** Same steps as tool calling, one `run_code` per step: fetch invoice, `update_attendance`, `void_invoice`, `create_invoice` from `inv['lines'][1:]`. Passed in 5 requests. ($0.034, 5 requests, 17 s)
- Right: Reused the fetched invoice lines to build the new invoice rather than retyping ids
- Right: Kept each write in its own `run_code` call, so each result was checked before the next
- Mistake: Assumed the 7 October lesson was `inv['lines'][0]` without checking the description in code; it was right because the line was visible in the previous output

### large-record_payment-1

**Tool calling: passed.** Found the client, listed unpaid invoices and allocations, and recorded the 50126 payment split 37626 to `INV-02840` and 12500 to `INV-03247`. Passed in 5 requests. ($0.058, 5 requests, 15 s)
- Right: Subtracted the existing 21152 allocation on `INV-02840` (58778 − 21152 = 37626) before allocating
- Right: Allocated oldest due date first and reported the 12504 left on `INV-03247`
- Mistake: `list_invoices` and `list_allocations` were sent in separate requests when they could have been parallel; minor

**Code mode: passed.** Computed the allocation in code from unpaid invoices and unreleased allocations, then called `record_payment` in the same snippet. Passed in 4 requests. ($0.071, 4 requests, 17 s)
- Right: Sorted by `due_date` and ignored allocations with `released_on` set
- Right: Same split as expected: 37626 to `INV-02840`, 12500 to `INV-03247`
- Mistake: The write was issued in the same snippet that computed the allocation, so the split was not looked at before it was committed
