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

# GPT-5.6 Luna on Pydantic AI - Billing ops

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

| Mode         | Score | Tasks passed | Cost   | Requests | Tool calls | Time    |
| ------------ | ----- | ------------ | ------ | -------- | ---------- | ------- |
| Tool calling | 30%   | 3 of 10      | $0.094 | 49       | 276        | 3.8 min |
| Code mode    | 70%   | 7 of 10      | $0.050 | 83       | 85         | 4.4 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

gpt-5.6-luna passed 4 of 10 cases in tools mode and 7 of 10 in code mode. It is very cheap: no case cost more than $0.03. Simple lookups and the void-and-reissue correction pass in both modes. Its weak spots are questions that need scanning hundreds of invoices, and long arithmetic done in its head.

#### Where it does well

- **Multi-step changes:** `large-correction-2` was exact in both modes. It updated attendance, then voided, then reissued, all dated today.
- **Simple lookups:** both `small-invoice_total-1` and `small-owed_on_invoices-1` passed in each mode, in 2–4 requests.
- **Code mode on big data:** with the sandbox it looped over all ~394 October invoices and solved `large-duplicate_lines-1` and `large-missed_billed-1`.

#### Mistakes it makes

- **Gives up on large scans (3 tools cases):** in `large-duplicate_lines-1` it made about 130 single `get_invoice` calls and stopped a third of the way through. In `large-missed_billed-1` it opened only about 20 invoices. Both returned `[]`, backed by reasoning that nothing could be wrong. In `large-wrong_invoices-1` it opened only 3 invoices.
- **Mental arithmetic (2 tools cases):** both tutor-margin answers in tools mode were computed in private reasoning and were wrong, 4575 too high and 3668 too low.
- **Skipped a rule:** in `large-record_payment-1` (tools) it allocated the whole payment to the invoice total without checking existing allocations.
- **Incomplete recomputation logic (3 code cases):** the wrong-invoice scripts priced the lines that were actually on each invoice, so duplicate lines and wrongly billed lines were never flagged. Small: missed INV-00158. Large: 5 of 12 found. The `small-tutor_margin-3` script treated every lesson as hourly and added tutor pay once per attendance row instead of once per lesson.
- No case failed because of the provider.

#### Tool calling compared with code mode

Code mode fixed 3 of the 6 tools failures: duplicate lines, missed-billed and large tutor margin. It also got `large-record_payment-1` right because it checked the allocations first. It lost nothing that tools mode passed. `small-tutor_margin-3` failed in both modes, and so did both wrong-invoices cases. In the wrong-invoices cases each mode caught errors the other missed: tools spotted the INV-00158 duplicate by eye, and code caught the INV-00162 tax error and the INV-00176 overcharge. Code mode used more requests (for example 16 against 9 on missed-billed), but often cost less, because the sandbox kept the bulk records out of the model's context.

## Runs

### small-invoice_total-1

**Tool calling: passed.** Answered 89700 correctly in 2 requests. ($0.0009, 2 requests, 3 s)
- Right: Took the most direct route

**Code mode: passed.** Answered 89700 correctly in 2 requests. ($0.0013, 2 requests, 2 s)
- Right: Correct and cheap

### small-owed_on_invoices-1

**Tool calling: passed.** Answered 85204 correctly in 4 requests. ($0.0007, 4 requests, 8 s)
- Right: Got the correct total

**Code mode: passed.** Answered 85204 correctly in 4 requests. ($0.0008, 4 requests, 10 s)
- Right: Got the correct total

### large-tutor_margin-3

**Tool calling: failed.** Fetched the tutor, the lessons, the settings, the attendance and 18 clients through `get_client`, then worked out the margin in its private reasoning and answered 125316. The expected answer was 120741. ($0.0070, 5 requests, 28 s)
- Right: Collected all the inputs it needed, including each client's `is_taxable`
- Mistake: Did the sums for dozens of lessons in its head with no tool to check them, and was 4575 too high

**Code mode: passed.** Computed the margin in Python and got exactly 120741. ($0.0055, 7 requests, 26 s)
- Right: The sandbox did the arithmetic, which removed the mental-arithmetic error from tools mode

### small-tutor_margin-3

**Tool calling: failed.** Fetched the lessons, attendance and 7 clients, then worked out the margin in its head as 61377. The expected answer was 65045. ($0.0045, 5 requests, 23 s)
- Right: Collected the right records
- Mistake: Did the arithmetic by hand with no working shown and was 3668 too low

**Code mode: failed.** Fetched page 1 of the lessons, the attendance and the clients, then summed revenue and tutor pay in Python. It got 187435 − 110902 = 76533; the expected answer was 65045. ($0.0047, 6 requests, 31 s)
- Right: Used `Decimal` with `ROUND_HALF_UP`
- Right: Handled net and gross pricing and taxable clients
- Mistake: The code treated every lesson as `hourly` and never branched on `charge_type` (one_off or split)
- Mistake: It added tutor pay once per attendance row instead of once per lesson

### large-duplicate_lines-1

**Tool calling: failed.** Paged through the ~394 October invoices, then called `get_invoice` one at a time, about 130 calls in parallel batches. It stopped about a third of the way through, convinced itself there were no duplicates, and returned `{"ids": []}`. ($0.029, 6 requests, 41 s)
- Right: Read the question correctly as duplicate (lesson, student) lines within an invoice
- Right: Batched the `get_invoice` calls in parallel
- Mistake: Partway through its reasoning it started looking at duplicates across invoices instead
- Mistake: Stopped scanning before the INV-0606x–0609x range, where all three expected invoices were, and answered `[]` with no evidence for it

**Code mode: passed.** Fetched every invoice in code and checked for repeated (lesson, student) pairs. It returned all 3 correct IDs. ($0.0048, 10 requests, 25 s)
- Right: Covered all ~394 invoices by looping in the sandbox, which tools mode couldn't manage

### large-missed_billed-1

**Tool calling: failed.** Listed the paid and unpaid October invoices, fetched only about 20 with `get_invoice`, and called `list_attendance` for a subset of their lessons. It then argued that the system can't bill missed students and returned `[]`. ($0.030, 9 requests, 48 s)
- Right: Left out void invoices by filtering on status
- Mistake: Checked attendance only for a few invoices (around INV-06145–06154) instead of every line of all ~394 invoices
- Mistake: Concluded that no anomalies could exist, although the question implies some do

**Code mode: passed.** Joined invoice lines to attendance in code and returned INV-05821, INV-05846 and INV-06080, which was correct. ($0.0084, 16 requests, 39 s)
- Right: Checked every line against attendance
- Mistake: Took 16 requests, but still cost only $0.0084

### large-wrong_invoices-1

**Tool calling: failed.** Listed the October invoices (paid, unpaid and void), opened just 3 with `get_invoice` whose tax looked odd, and reported those 3. All 3 were correct, but 9 of the 12 wrong invoices were missing. ($0.0099, 5 requests, 28 s)
- Right: The 3 amounts it reported (INV-05851 1050, INV-06016 1150, INV-06105 1875) were exact
- Mistake: Picked a few suspects from the summary totals instead of recomputing every invoice from its lessons and attendance, so it missed the duplicate-line and missed-but-billed invoices

**Code mode: failed.** Recomputed the invoices in code, over 15 requests, and reported 5 invoices. All 5 amounts were correct, but 7 of the 12 were missing, including the duplicate-line invoices (06060, 06073, 06097) and the missed-but-billed ones (05821, 05846). ($0.011, 15 requests, 50 s)
- Right: Exact amounts for INV-05877, 06016, 06017, 06080 and 06105
- Mistake: Its recomputation priced each line actually on the invoice and compared, so duplicate lines and lines that shouldn't exist at all passed the check

### small-wrong_invoices-1

**Tool calling: failed.** Opened 37 invoices and spotted the duplicate on INV-00158 (4050) and the wrong rate on INV-00172 (600). It missed INV-00162 and INV-00176. ($0.0095, 4 requests, 25 s)
- Right: Spotted the duplicate line and the rate anomaly by eye
- Mistake: Decided the zero-tax line on INV-00162 was probably an undercharge without recomputing it
- Mistake: Never recomputed every line from the lessons, so it missed INV-00176 (6000)

**Code mode: failed.** Recomputed every line's expected total in code and found INV-00162, INV-00172 and INV-00176. It missed INV-00158 (4050), the one tools mode found. ($0.0093, 11 requests, 40 s)
- Right: Caught the zero-tax error (863) and the 6000 overcharge that tools mode missed
- Mistake: Its thinking noticed the duplicate line LS-001226, but the `calc` function priced each copy as a correct line, so the duplicate was never flagged

### large-correction-2

**Tool calling: passed.** Called `search_clients` and `get_invoice` in parallel, then `update_attendance` (LS-045235 → missed), `void_invoice`, and `create_invoice` with the 3 remaining lines. The result matched the expected changes exactly. ($0.0012, 5 requests, 13 s)
- Right: Took the lesson and student IDs straight from the invoice lines
- Right: Did the steps in the right order: attendance, then void, then reissue, all dated 2026-11-13
- Right: Used 5 requests

**Code mode: passed.** Made the same correct sequence as in tools mode, through `run_code`, and matched the expected changes exactly. ($0.0018, 7 requests, 21 s)
- Right: Got the void and reissue right, with the new invoice paid from the released credit

### large-record_payment-1

**Tool calling: failed.** Found CL-0294 and its unpaid invoices, then called `record_payment` with all 50126 allocated to INV-02840. It never checked what was already paid on that invoice. 37626 should have gone to INV-02840 and 12500 to INV-03247. ($0.0013, 4 requests, 11 s)
- Right: Chose the oldest-due invoice first
- Right: Recorded the payment with the right amount and date
- Mistake: At the `record_payment` step it used the invoice total (58778) as the amount outstanding. It never checked existing allocations, so it put 50126 on an invoice that only had 37626 left, when it should have split the payment across INV-02840 and INV-03247

**Code mode: passed.** Looked at the existing allocations and split the payment 37626 to INV-02840 and 12500 to INV-03247, which was correct. ($0.0024, 5 requests, 19 s)
- Right: Worked out what was still owed on each invoice before allocating the payment
