---
title: "Kimi K3.1 Pro on Pydantic AI - Structured output"
description: "Extracting UK company accounts into a nested Pydantic model, checked against the filer's tags. Tool calling 100%; rank 1 of 44."
canonical: https://pydantic.dev/models/list/kimi-k3.1-pro/structured_output/
---

# Kimi K3.1 Pro on Pydantic AI - Structured output

> Extracting UK company accounts into a nested Pydantic model, checked against the filer's tags. Tool calling 100%; rank 1 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/kimi-k3.1-pro/structured_output/. 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/structured_output.md. The model on every Pydantic AI benchmark: https://pydantic.dev/models/list/kimi-k3.1-pro/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time    |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | ------- |
| Tool calling | 100%  | 10 of 10     | $0.67 | 11       | 11         | 4.3 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

Kimi-K3.1-Pro passed all 10 cases in tool-calling mode (2 each across tiers 1 to 5). Nine finished in a single request; one needed a second after a schema validation error. Cost per case ran from $0.046 to $0.106, about $0.67 in total. No arithmetic check was ever triggered.

#### Where it does well

- **Sign rules.** Net liabilities, deficits and tax credits were negative and creditors, provisions and costs positive in every case. It handled the flipped line in `tier2-SC121467` (shown as (299) and 571, returned as `tax` 299000 and -571000) and the bracketed charge in `tier1-11022760`.
- **£000 scaling.** All three thousand-presented sets (`tier1-07054261`, `tier1-11022760`, `tier2-SC121467`) were multiplied correctly, including a share capital of 1 becoming 1000 and a dash becoming 0.
- **Group versus parent.** In the six cases that ask for both, no figure was taken from the wrong column, even where they differ by a few hundred pounds (`tier5-NI037684`).
- **Self-checking.** In `tier2-11600506` and `tier4-NI626135` it re-added the P&L and each creditors column before submitting.
- **Not computing.** In `tier4-05840865` it left 'Other creditors' whole rather than subtracting director loans mentioned in a sentence; in `tier5-12026946` it did not fold associate income into `interest_receivable`.

#### Mistakes it makes

- **Schema misread (1 case).** In `tier5-NI037684` it sent `null` for `parent_company.staff_costs`, which the schema does not allow, and had to resend the whole payload. This was the only wasted request.
- **Inconsistent null versus 0 on unscored fields (4 cases).** `tier3-09727592` reasoned that group `intangible_assets` and `investments` should be `null`, then sent 0; `tier3-05959188` sent `null` in the same situation. `tier2-SC121467` sent `creditors_after_one_year` 0, and `tier5-12026946` added zero-amount creditor lines. None was checked, so these passes carry some luck.
- **Computed a figure (1 case).** In `tier1-07054261` it summed debtor lines into `debtors` 9792000 because the checker 'likely expects' it, against the handbook. Also unscored.
- Its reasoning often tries to guess what the validator wants rather than applying the handbook rule directly.

#### Tool calling compared with code mode

Only tool-calling mode was run for this benchmark, so there is no comparison to make.

## Runs

### tier1-07054261

**Tool calling: passed.** Read the £000 accounts and returned everything in one `accounts` call, multiplying by 1,000; passed on the first request. ($0.064, 1 requests, 22 s)
- Right: Scaled £000 figures correctly, e.g. `net_assets` -6187000 and `called_up_share_capital` 1000 (balance sheet shows 1, note shows 1,120 shares of £1; it kept the statement figure)
- Right: Signs right: `operating_profit` -940000, prior `tax` -138000 as a credit, `creditors_within_one_year` positive
- Mistake: In its reasoning before the call it decided to add up separately shown debtor lines to give `debtors` 9792000 (prior 10162000), reasoning that the check 'likely expects' a total; the handbook says not to compute figures the accounts do not show. The field is not in the expected set, so it did not affect the result.

### tier1-11022760

**Tool calling: passed.** Extracted company details, both balance sheets and both P&Ls from £000 accounts in a single `accounts` call; passed. ($0.058, 1 requests, 22 s)
- Right: Resolved the share capital question (note shows 0.10, balance sheet a dash) to `called_up_share_capital` 0
- Right: Read prior `tax` as a 632000 charge despite the bracketed '(charge)/credit' label, confirming it against the tax note
- Right: Kept net liabilities negative (`net_assets` -20029000) and creditors positive

### tier2-11600506

**Tool calling: passed.** Returned the group balance sheet and P&L for both years in one `accounts` call after re-adding the P&L in its reasoning; passed. ($0.046, 1 requests, 11 s)
- Right: Checked arithmetic before submitting (33,135,446 - 25,037,414 = 8,098,032; then to `profit_before_tax` 953487)
- Right: Left group `investments`, `distribution_costs` and `share_premium` as `null` because the group statement has no such line
- Right: Negative `total_assets_less_current_liabilities` -857995 with positive `provisions` 346932

### tier2-SC121467

**Tool calling: passed.** Extracted the group balance sheet and P&L from £000 accounts in one call; passed. ($0.059, 1 requests, 18 s)
- Right: Handled the sign flip on the 'Tax on profit/(loss)' line: shown as (299) and 571, returned as `tax` 299000 (charge) and -571000 (credit)
- Right: Scaled all figures by 1,000 and kept `profit_and_loss_reserve` -1296000 negative
- Mistake: Returned current `creditors_after_one_year` as 0 rather than `null`; the field is not in the expected set, so it was not scored.

### tier3-05959188

**Tool calling: passed.** Returned group and parent balance sheets for both years in one `accounts` call; passed. ($0.057, 1 requests, 13 s)
- Right: Kept group and parent figures apart (e.g. `tangible_assets` 379315 group vs 9602 parent; `creditors_within_one_year` 2483825 vs 3852856)
- Right: Left group `investments` `null` because the consolidated statement has no line, while giving the parent 2467 / 2446
- Right: Noted the schema has no field for the equity reserve and did not force the reserves to add up

### tier3-09727592

**Tool calling: passed.** Returned group and parent balance sheets for both years in one call; passed. ($0.071, 1 requests, 35 s)
- Right: Parent prior `investments` given as 0 where the statement shows a dash on a printed line, matching the expected value
- Right: Net liabilities negative for group (`net_assets` -3674263) while parent prior `net_assets` 783514 stayed positive
- Right: Positive `provisions` 5889
- Mistake: Its reasoning argued group `intangible_assets` and `investments` should be `null` (no line on the group balance sheet), but the call sent 0 for both in both years. Neither field is in the expected set, so it was not scored; it is inconsistent with what it did in tier3-05959188.

### tier4-05840865

**Tool calling: passed.** Extracted staff costs and the creditors note lines for group and parent in one call; passed. ($0.063, 1 requests, 29 s)
- Right: Left 'Other creditors' whole (`other` 1278154, prior 820961) instead of subtracting the director loan accounts of £48,817 mentioned in a sentence under the note, citing the no-computation rule
- Right: Included the zero current `bank_loans_and_overdrafts` line with `prior_amount` 10251
- Right: Parent `finance_leases` split by due date: 11658 within, 28174 after
- Mistake: Spent a long stretch of reasoning on whether to add an `amounts_owed_to_directors` line; the outcome was right but it was guessing at what the checker wanted rather than applying the rule directly.

### tier4-NI626135

**Tool calling: passed.** Extracted staff costs and creditors lines for group and parent in one call after summing each note in its reasoning; passed. ($0.058, 1 requests, 19 s)
- Right: Added up every creditors column before submitting (group within one year to 15,752,489 and prior to 14,579,974) and each staff cost total
- Right: Kept the after-one-year `bank_loans_and_overdrafts` line with `amount` 0 and `prior_amount` 5836 because the note prints the line with a dash
- Right: Kept `amounts_owed_to_group` 3668476 in the group note even though it remarked that was odd for consolidated figures

### tier5-12026946

**Tool calling: passed.** Returned the full set (company info, directors, group and parent balance sheets, group P&L, staff costs, creditors) in one `accounts` call; passed. Most expensive single-request case at $0.0865. ($0.087, 1 requests, 39 s)
- Right: Used only the 'Other interest receivable and similar income' line for `interest_receivable` (374360 / 177077) and did not fold in associate or fixed-asset investment income, which the schema has no field for
- Right: Tax signs: 72816 charge, prior -51830 credit
- Right: All four directors listed; `accounts_type` 'full', `consolidated` true
- Mistake: Added creditor lines with `amount` 0 that the expected set does not contain (group `amounts_owed_to_group` 0 / 0, a parent after-one-year line 0 / 157084); they did not fail the check.

### tier5-NI037684

**Tool calling: passed.** First `accounts` call was rejected by schema validation; it resent the whole payload with one fix and passed on the second request, at $0.1062, the costliest case. ($0.11, 2 requests, 48 s)
- Right: Read the validation error correctly and resubmitted with `parent_company.staff_costs` and `prior_staff_costs` as objects of `null` fields, changing nothing else
- Right: Group and parent creditors kept apart where they differ slightly (e.g. `other_tax_and_social_security` 152260 vs 151765; prior `trade_creditors` 2698613 vs 2689140)
- Right: Used `amounts_owed_to_directors` 18372 / 5938 for the directors line
- Mistake: First call sent `"staff_costs":null` and `"prior_staff_costs":null` for the parent; the tool returned `Input should be an object` at `parent_company.staff_costs`. The schema's `anyOf` for those fields has no null branch, so it should have sent objects from the start. This doubled the requests and re-sent the full payload.
- Mistake: Sent group `fixed_assets` as `null` and `investment_property` 523300 for the current year with 0 for the prior year; none of these are in the expected set, so they were not scored.
