---
title: "GPT-6.1 Sol 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 80%; rank 4 of 44."
canonical: https://pydantic.dev/models/list/gpt-6.1-sol/billing_ops/
---

# GPT-6.1 Sol on Pydantic AI - Billing ops

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

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 90%   | 9 of 10      | $2.77 | 98       | 975        | 14.2 min |
| Code mode    | 80%   | 8 of 10      | $0.25 | 61       | 61         | 3.1 min  |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

`gpt-6.1-sol` passed 17 of 20 runs: 9/10 in tool calling and 8/10 in code mode. All three failures are on the "which invoices charge the wrong amount" audit; every other task passed in both modes. Tool calling cost $2.77 in total against $0.25 for code mode.

#### Where it does well

- **Write tasks**: both corrections and both payments were exact in 4–5 requests. Steps were in the right order (`update_attendance`, then `void_invoice`, then `create_invoice`) and allocations went oldest-due-first (37626 to INV-02840, 12500 to INV-03247).
- **Margin**: all four runs were exact (120741 and 65045). In tool calling it did this with unrecorded mental arithmetic over up to 67 lessons, fetching only the three clients on gross-priced lessons.
- **Lookups**: invoice total and amount owed took 2–4 requests with no wasted calls.
- **Single-fault audits**: duplicate lines and missed-but-billed passed in both modes.
- **Recovery**: after hitting the 100 nested-call limit in code mode, it checked `len(details)` and resumed without refetching.

#### Mistakes it makes

- **Incomplete audit logic (3 failures)**: the wrong-invoices task has several fault types, and each failing run missed one whole class.
  - Tool calling, large: it checked attendance for only 11 lessons, so it missed the three invoices billing a `missed` student (INV-05821, INV-05846, INV-06080).
  - Code mode, large: its code summed expected totals over every line, so repeated lines looked legitimate, and it missed exactly the three duplicate-line invoices (INV-06060, INV-06073, INV-06097).
  - Code mode, small: the same code missed INV-00158; a duplicate line there is inferred, since the run never inspected it.
- **No cross-check**: it never ran a second check before `final_result`, even though it solved each missed fault type correctly as a standalone task.
- **Stray calls**: `search_clients(name="")` appeared in both tool-calling audit runs.

#### Tool calling compared with code mode

|                        | Tool calling                | Code mode                  |
| ---------------------- | --------------------------- | -------------------------- |
| Passed                 | 9/10                        | 8/10                       |
| Total cost             | $2.77                       | $0.25                      |
| Large audits (3 cases) | $0.72–$0.96, 15–36 requests | $0.03–$0.05, 8–13 requests |

On small tasks, cost and request counts were about equal. On the large audits, tool calling pulled 550–680KB of records through context per case, which made it 15–24x more expensive.

Code mode was exact wherever its logic was right, but a single logic gap failed both the small and large audit. Tool calling passed the small audit by reading everything, then failed the large one by sampling. Neither mode is reliable on the multi-fault audit at scale. For everything else, code mode gives the same answers at about a tenth of the cost.

## Runs

### small-invoice_total-1

**Tool calling: passed.** One `get_invoice` call for INV-00084, then returned its `total`. Passed with 89700 in 2 requests. ($0.0085, 2 requests, 3 s)
- Right: Minimal path, no extra calls

**Code mode: passed.** One `run_code` wrapping `get_invoice`, then returned the total. Passed with 89700 in 2 requests. ($0.012, 2 requests, 4 s)
- Right: Minimal path

### small-owed_on_invoices-1

**Tool calling: passed.** Found CL-0007, read unpaid invoices and allocations in parallel, and subtracted the one live allocation. Passed with 85204 in 3 requests. ($0.0093, 3 requests, 7 s)
- Right: Counted only the 3563 allocation on INV-00155 against the unpaid totals 39452 + 49315

**Code mode: passed.** Looked up the client, invoices and allocations, then summed totals minus live allocations in code. Passed with 85204 in 4 requests. ($0.0063, 4 requests, 10 s)
- Right: Filtered allocations on `invoice_id in ids` and `released_on is None`
- Mistake: Used a separate `run_code` for a one-line subtraction, one request more than tool calling

### large-tutor_margin-3

**Tool calling: passed.** Got the tutor, settings, 75 lessons and attendance for the 67 billable ones, fetched three clients, and computed the margin without a calculator. Passed with 120741 in 5 requests. ($0.039, 5 requests, 26 s)
- Right: Filtered out `cancelled` lessons before calling `list_attendance`
- Right: Only fetched `get_client` for 3 clients (CL-0097, CL-0269, CL-0065), apparently just those on gross-priced lessons where `is_taxable` changes the net
- Right: Arithmetic over 67 lessons was exact
- Mistake: No visible working, so the correct figure rests on unrecorded mental arithmetic

**Code mode: passed.** Fetched lessons, attendance and 18 clients, then computed revenue 360316 less tutor pay 239575 with `Decimal` and `ROUND_HALF_UP`. Passed with 120741 in 6 requests. ($0.028, 6 requests, 20 s)
- Right: Half-up rounding per student and per lesson, gross tax as `cost*rate/(1+rate)`
- Right: Returned an audit dict with revenue, pay and lesson count
- Mistake: Sent 67 lesson IDs in a single `list_attendance` call without checking for a batch limit; it worked

### small-tutor_margin-3

**Tool calling: passed.** Same pattern as the large margin case: tutor, settings, 39 lessons, attendance for 37, three clients, then mental arithmetic. Passed with 65045 in 5 requests. ($0.023, 5 requests, 20 s)
- Right: Excluded the two `cancelled` lessons and the `missed` attendances
- Right: Fetched only CL-0037, CL-0002 and CL-0008, the clients on gross-priced lessons

**Code mode: passed.** Same code as the large margin case on 37 billable lessons: revenue 187435 less pay 122390. Passed with 65045 in 6 requests. ($0.024, 6 requests, 18 s)
- Right: Correct handling of non-taxable clients CL-0030 and CL-0037 and of gross-priced lessons
- Mistake: Dumped full lesson, attendance and client lists into context rather than samples

### large-duplicate_lines-1

**Tool calling: passed.** Paged `list_invoices` (4 pages), then pulled all 384 non-void invoices with `get_invoice` in batches of about 30 per request and spotted the three duplicates by reading. Passed, but took 16 requests and $0.72. ($0.72, 16 requests, 2.6 min)
- Right: Covered every non-void invoice, skipping void ones such as INV-05811 and INV-05817
- Right: Correctly identified the duplicated (student, lesson) pairs: ST-0461/LS-044150, ST-0483/LS-042250, ST-0515/LS-044126
- Mistake: Costly: about 638KB of invoice bodies passed through context over 13 batched requests, about 24x the cost of the code-mode run ($0.7178 vs $0.0304)

**Code mode: passed.** Paged invoices, fetched 384 `get_invoice` results in batches of 90 across five `run_code` calls, and used a `Counter` on `(student_id, lesson_id)`. Passed in 8 requests for $0.03. ($0.030, 8 requests, 22 s)
- Right: Kept batches at 90 to stay under the 100 nested-call limit
- Right: Printed only counts and matches, so little data entered context
- Mistake: Echoed the full first page of 100 invoices into context in the first call, which was not needed

### large-missed_billed-1

**Tool calling: passed.** After fetching about 20 invoices it switched to scanning attendance by consecutive lesson-ID ranges (`list_attendance` with 100 IDs from LS-041700 to about LS-0447xx), then confirmed with `get_invoice` on the three hits. Passed, at 36 requests and $0.96, the most expensive case. ($0.96, 36 requests, 5.8 min)
- Right: Found a shortcut: scan attendance for `missed` rows instead of loading all 384 invoices
- Right: Verified the candidates with `get_invoice` on INV-05846, INV-06080 and INV-05821 before answering
- Mistake: Sent the roughly 30 `list_attendance` range calls one per request instead of in parallel, which drove the 36 requests
- Mistake: Guessed contiguous lesson IDs rather than taking them from invoice lines; this worked but relied on the ID range covering every invoiced lesson

**Code mode: passed.** Fetched all 384 invoices in batches, pulled attendance for the 2,655 invoiced lesson IDs, and matched lines against `missed` rows. Passed in 8 requests for $0.04. ($0.040, 8 requests, 23 s)
- Right: Took lesson IDs from the invoice lines, unlike the ID-range guess in tool calling
- Right: Set membership test on `(lesson_id, student_id)` gives an exact check
- Mistake: Echoed the full first invoice page into context

### large-wrong_invoices-1

**Tool calling: failed.** Fetched all the October invoices but checked lessons and attendance only for a handful of suspects, so it returned 9 of the 12 wrong invoices. Failed: missing INV-05821, INV-05846 and INV-06080. ($0.77, 15 requests, 3.2 min)
- Right: The 9 rows returned all have the right amounts, including the duplicate-line invoices INV-06060 (3563), INV-06073 (4500) and INV-06097 (9900)
- Right: Fetched every invoice body in parallel batches
- Mistake: Around message 25 it called `list_attendance` for only 11 lesson IDs and `get_lessons` for 9; it never loaded attendance for all 2,655 invoiced lessons, so the three invoices that bill a `missed` student could not be detected by eye
- Mistake: It should have run `list_attendance` over every invoiced lesson ID, as it did in the small variant
- Mistake: Wasted calls: `search_clients(name="")` and a `list_lessons` for September page 1 that was never continued

**Code mode: failed.** Loaded every invoice, lesson, attendance row and client, then recomputed each invoice as the sum of its lines' expected totals. Failed: returned 9 of 12 rows, missing INV-06060, INV-06073 and INV-06097. ($0.051, 13 requests, 44 s)
- Right: Complete data load and correct per-line pricing, tax and missed-student logic
- Right: Recovered from the 100 nested-call limit error by checking `len(details)` (140) and resuming at index 140 without refetching
- Mistake: In the final `run_code`, `expected()` was summed over every line, so a line repeated for the same `(lesson_id, student_id)` was treated as legitimately owed twice; the three missing invoices are exactly the duplicate-line ones
- Mistake: It should have de-duplicated lines per invoice before summing expected totals
- Mistake: Third `run_code` looped 90-call batches in one snippet and hit the 100-call limit
- Mistake: 384 individual `get_client` calls across four requests just to read `is_taxable`

### small-wrong_invoices-1

**Tool calling: passed.** Loaded all 37 invoices, September lessons (4 pages), attendance for every lesson and all 37 clients, then recomputed by reading. Passed with all four rows in 7 requests. ($0.21, 7 requests, 76 s)
- Right: Loaded complete data: 37 parallel `get_invoice`, three `list_attendance` batches, 37 parallel `get_client`
- Right: Caught INV-00158 (4050), which the code-mode run missed
- Mistake: Stray `search_clients(name="")` call
- Mistake: Assumed all invoiced lessons fell in September via `list_lessons` rather than using the invoice lines' lesson IDs; it held here
- Mistake: $0.21 for a small dataset

**Code mode: failed.** Loaded 37 invoices, 280 lessons, attendance and clients, then recomputed with the same sum-over-lines code. Failed: returned 3 of 4 rows, missing INV-00158 (4050). ($0.029, 5 requests, 22 s)
- Right: The three rows returned are correct, with an audit list of actual vs expected
- Right: Efficient: 5 requests, $0.03
- Mistake: Same flaw as the large case: expected totals were summed over every line without checking for a repeated `(lesson_id, student_id)`, which is the one fault type this code cannot see; the run never inspected INV-00158, so the duplicate there is inferred, not shown
- Mistake: No cross-check of the result, for example a duplicate-line scan, before `final_result`

### large-correction-2

**Tool calling: passed.** Looked up the client and invoice in parallel, then ran `update_attendance`, `void_invoice` and `create_invoice` in order. Passed in 5 requests with the exact expected changes. ($0.0080, 5 requests, 13 s)
- Right: Parallel `search_clients` + `get_invoice` in the first request
- Right: Correct order: `update_attendance(LS-045235, ST-0332, missed)`, then `void_invoice(date=2026-11-13)`, then `create_invoice` with the three remaining lessons
- Right: Summary reports the new invoice INV-06548, 17100 pence, paid from credit

**Code mode: passed.** Same four steps as tool calling, each in its own `run_code` call, building the new invoice lines from the old invoice minus LS-045235. Passed in 5 requests. ($0.0087, 5 requests, 13 s)
- Right: `asyncio.gather` for the two lookups
- Right: Derived the reissue lines in code from `inv['lines']` rather than retyping them

### large-record_payment-1

**Tool calling: passed.** Found CL-0294, read unpaid invoices and allocations in parallel, then called `record_payment` with explicit allocations. Passed in 4 requests. ($0.013, 4 requests, 10 s)
- Right: Worked out by hand that INV-02840 had 21152 already allocated, so 37626 clears it and 12500 goes to INV-03247
- Right: Converted £501.26 to `50126` and dated it 2026-11-13

**Code mode: passed.** Looked up the client, invoices and allocations, then computed oldest-due-first allocations in code and called `record_payment`. Passed in 4 requests. ($0.018, 4 requests, 13 s)
- Right: Sorted by `(due_date, id)` and ignored released allocations
- Right: Returned `unallocated: 0` as a check
