Can you build your own invoice and bank statement extraction with Claude or Gemini? A 2026 guide for firms

Claude and Gemini APIs can read invoices and bank statements for cents. Here is what a DIY build must also handle, from splitting files to Xero posting, and when it is enough.

Some firms no longer ask which capture tool to buy. On our sales calls between 23 and 27 November 2026, several told us they already extract documents themselves with Claude or Gemini. One was weighing its own Claude build against buying a tool, and wanted to know which costs less.

Quick answer: Yes, you can build your own invoice and bank statement extraction with the Claude or Gemini API, and the model bill is small, often a few US cents per document. The hard part is everything around the model. You have to split files, balance statements and code to each client's chart of accounts. Then you post through Xero or QuickBooks, keep an audit trail and fix it all when models change. A DIY build makes sense for one-off clean-ups, small volumes or a firm with its own developer. For steady monthly volume across many clients, a dedicated capture tool usually costs less in staff time.

We make tofu, so weigh our view accordingly. We have tried to show the DIY route fairly, with prices from the vendors' own pages.

What are firms already doing with Claude, Gemini and ChatGPT?

Three patterns came up again and again on our calls. One Malaysian firm runs its bank statements through Gemini at no cost. Another firm built its own extraction with Claude Code and told us it spends a few thousand ringgit a year running it. Other teams paste documents into ChatGPT or Claude one at a time, then worry about whether the numbers are right.

One firm asked us a sharp question. Which models does a tool run on, and does it stop working when a model provider goes down? Keep that question in mind. It applies to your own build too.

The big vendors are also moving into this space. Here is what changed recently, checked on vendor pages in November 2026.

VendorWhat launchedWhat it does for firms
OpenAIChatGPT for accounting work help guide and Accounting plugin, live when checked in November 2026Drafts reconciliations, invoice and receipt entries and reports for review, with partner plugins including Xero and QuickBooks Online
MicrosoftAccounting skills in Copilot in Excel, offered through Microsoft's Frontier programme in November 2026Helps reconcile accounts and draft journal entries in Excel, and prepares reconciling items for you to review
DextAI Connector, launched October 2026Lets Claude, ChatGPT or Copilot read Dext practice data; it can't make changes in Dext

If you want the bigger picture on chat assistants, we covered that in can Claude do your bookkeeping and can ChatGPT handle your bookkeeping. This guide is about the next step: writing code against a model API and running it as your own extraction system.

How much does it cost to run extraction on the Claude or Gemini API?

Less than most partners expect. Both vendors charge per token, and a PDF page turns into a known number of tokens.

ItemClaude APIGemini API
Example model and price per million tokens (input / output)Sonnet 5.5: $2 / $10. Haiku 5.5: $0.10 / $0.50 for prompts up to 100,000 tokensGemini 3.5 Flash: $1.50 / $9.00. Gemini 2.5 Flash: $0.30 / $2.50
Tokens per PDF page1,500 to 3,000 text tokens, plus up to 1,568 image tokens258 tokens per page
PDF limit per request600 pages (100 if the context window is under 1M tokens), 128 MB1,000 pages or 50 MB
Batch discount50% off with the Batch API50% off with the Batch API

Prices are in US dollars, checked on the Claude pricing page, Claude PDF docs, Gemini pricing page and Gemini document docs in November 2026.

Here is our own rough sum, not a vendor figure. Take a 10-page bank statement with 60 transactions. On Gemini 3.5 Flash, the pages come to about 2,600 input tokens at 258 tokens a page. Say the answer and the model's thinking take 4,000 output tokens. That comes to roughly US$0.04. The same file on Claude Sonnet 5.5 lands at about US$0.10 to US$0.13, because each page carries 1,500 to 3,000 text tokens plus up to 1,568 image tokens.

So the token bill is rarely what decides this. Staff time is. The rest of this guide is about where that time goes.

What does a DIY build have to handle?

Reading one clean invoice is the easy 20%. A firm's real inbox holds the other 80%.

Splitting files that hold several documents

Clients scan a month of bills into one PDF. Banks send one statement with three accounts in it. Your code has to find where each document starts, send each one on its own, and cope when a page break sits in the wrong place. Long files bring their own trouble: Anthropic notes that dense PDFs can fill the context window before they reach the page limit.

Balancing long bank statements

A model can drop a row or read a debit as a credit on page 14. You will not see it unless your code checks the maths. That means comparing the opening balance plus every transaction against the closing balance, and checking the running balance line by line to find where it broke.

Coding to each client's chart of accounts

Extraction is only half the job. Each line needs the right account, tax code and tracking category for that client. In Malaysia that includes SST lines, which have to land on the tax codes each client uses in Xero or Bukku. Your build needs to pull every client's chart of accounts and remember how your team coded each supplier last time.

MyInvois e-invoices

LHDN's e-Invoice Guideline says a validated e-invoice gets an IRBM Unique Identifier Number, a validation date and time, and a validation link. Its PDF copy carries a QR code. A useful build captures that number with the rest of the data, so your team can trace a bill back to its validated record.

Posting through Xero and QuickBooks

Your extracted data is no use until it reaches the ledger. Both ledgers now charge app developers by tier, checked on their developer pages in November 2026.

LedgerFree optionPaid tiersNote for firms
XeroStarter plan, no charge, up to 5 connectionsFrom A$35 a month (Core, 50 connections)Xero says bespoke integrations built for your own practice or a single client are exempt from the new pricing
QuickBooks OnlineBuilder tier, uncharged, with a monthly cap on CorePlus callsSilver from US$300 a monthCalls above the Builder cap are blocked

Sources: Xero partner plans, Xero pricing FAQ, Intuit App Partner Program FAQ and Intuit's developer blog. You also have to handle sign-in tokens that expire, duplicate bills and attaching the source file to each entry.

Audit trail

When a reviewer asks why a bill went to the wrong account, you need an answer. Log which model and prompt read each document, what it returned, who changed what, and when it posted. Without that log, a DIY build is hard to defend at year end.

Client data and model terms

API terms differ from consumer chat apps, and free tiers differ from paid ones. Anthropic's Commercial Terms say it "may not train models on Customer Content from Services." Google's Gemini API terms say paid services don't use your prompts to improve its products. For unpaid services, Google says it uses your content to improve its products and human reviewers may read it. It also tells users not to submit confidential or personal information there. Google applies its paid-service data terms to unpaid use in the UK, the EEA (which includes Ireland) and Switzerland, but not in Malaysia or Singapore. A firm running client bank statements through a free Gemini API key in Malaysia should read that page closely.

Maintenance when models change

Models retire. Google's pricing page notes that Gemini 2.0 Flash is deprecated and was shut down on 1 June 2026. Each change means retesting your prompts on real client files. Someone has to own that work, and someone has to watch for the day the provider's API goes down.

DIY build, chat assistant or dedicated capture tool?

Here is how the three routes compare for a firm doing monthly bookkeeping.

QuestionDIY with an AI APIChat assistant (Claude, ChatGPT, Gemini)Dedicated capture tool
Who builds itYour developerNobody, you paste files inThe vendor
Running costTokens plus developer timeSeat licencesSubscription
Splitting multi-document filesYou code itManual, file by fileBuilt in
Balancing bank statementsYou code the checksYou check by eyeBuilt in on most tools
Coding per clientYou build and store the rulesYou re-explain each timeRules saved per client
Posting to Xero or QuickBooksYou build the integrationSome plugins draft entries for approvalDirect publishing on most tools
Audit trailWhatever you logChat historyBuilt in
When a model changesYou retestThe vendor handles itThe vendor handles it

When is a DIY Claude or Gemini build enough?

A DIY build is a sound choice in three cases.

  • One-off clean-ups. A new client hands over two years of statements once. A script plus a careful review can clear it in a day.
  • Small, steady volume. A handful of clients with clean, digital PDFs and one bank each. Your checks stay simple.
  • A firm with its own developer. If someone in-house can own the code, the logs and the model updates, you keep full control. Xero even exempts integrations built for your own practice from its new developer pricing.

The build gets harder as clients, banks, languages and file shapes multiply. That is usually the point where a firm starts comparing its developer's time with a subscription.

Where tofu fits

tofu is a dedicated capture tool for accounting firms. It does the work around the model, so your team reviews instead of building.

  • Preprocessing. AI Auto Split turns a PDF of several invoices, or a statement with several accounts, into separate extractions. The homepage lists handwriting recognition and 200+ languages.
  • Balanced bank statements. Bank statement checks compare opening and closing balances, totals and each running balance. For entities connected to Xero, publishing stays blocked until a mismatch is fixed.
  • Knowledge that compounds per client. Each entity has its own knowledge cards, with version history showing who changed what and when. Self-Prompt can learn from a client's past transactions.
  • Posting. tofu publishes direct to Xero, QuickBooks Online, Sage, Zoho Books and Bukku, with Xero bank feeds for statements.
  • Security. Our homepage says the LLMs tofu uses do not train on customer data, and that each customer's data and knowledge sits apart. Our trust centre lists Anthropic, Google Gemini and OpenAI among its AI subprocessors.

tofu also works with Claude rather than against it. Our Claude connector lets Claude answer questions about your tofu data and run usage reports. It can help rewrite a knowledge card, mark clean bills Ready or Done, and export extractions in your ledger's format. It only sees what your own tofu login allows, and it works on every Claude plan, including Free.

What tofu doesn't do: it doesn't replace your reviewer, and it isn't a general assistant for analysis or client emails. Claude and ChatGPT stay better for those one-offs.

GBS Malaysia, part of Cheng & Co, had clients sending many suppliers' invoices in one PDF, and documents in Chinese. Its team now finishes a client's invoices in under an hour, down from four to five hours. Read the GBS Malaysia case study.

"With tofu, they can save more time and go back on time. No need to always spend overtime just to close the bookkeeping."

Michele Lim, GBS Assistant Director

Pricing counts entries, not clients, and users and entities are unlimited. Pro is $72 and Business is $179 on yearly packs. Start a free trial or see pricing.

Frequently asked questions

Can I use the Claude API to extract invoices into Xero?

Yes. You send the PDF to the Claude API, ask for structured fields back, then post them through the Xero API. You will need a Xero developer app and your own code for contacts, accounts, tax codes and attachments. Xero says integrations built for your own practice are exempt from its new developer pricing.

Is Gemini free for bank statement extraction?

Google offers unpaid Gemini API quota, but its terms say unpaid content may be used to improve Google's products and read by human reviewers. Google tells users not to submit confidential or personal information to unpaid services. In the UK, the EEA and Switzerland the paid-service data terms also cover unpaid use; in Malaysia and Singapore they do not.

How much does DIY AI extraction cost per document?

Model costs are usually cents. Our rough sum for a 10-page statement is about US$0.04 on Gemini 3.5 Flash and US$0.10 to US$0.13 on Claude Sonnet 5.5. The bigger costs are developer time, review time and upkeep when models change.

What are the PDF limits for Claude and Gemini?

Claude accepts up to 600 pages per request, or 100 when the context window is under 1M tokens, and up to 128 MB. Gemini accepts PDFs up to 1,000 pages or 50 MB. Dense statements can hit context limits sooner, so long files often need splitting.

Does Claude train on documents sent through the API?

Anthropic's Commercial Terms say it may not train models on customer content from its services. Check which terms apply to your account, since consumer apps can differ from the API. Your firm still owns how it handles client data.

Can a DIY build handle MyInvois e-invoices and SST?

It can, if you code for them. Capture the IRBM Unique Identifier Number from validated e-invoices and map SST lines to each client's tax codes in Xero or Bukku. Test these cases on real files before relying on the build.

Does tofu work with Claude?

Yes. The tofu connector for Claude lets Claude read your tofu data, help fix knowledge cards, mark bills Ready or Done and export extractions in your ledger's format. Uploads through Claude use the same extraction quota as the tofu web app.

Sources

Checked against Anthropic, Google, Xero, Intuit, LHDN, OpenAI, Microsoft, Dext and tofu sources in November 2026.

Latest blog posts

Stay up to date on new Tofu features, automation workflows, and the emerging tech shaping the future of bookkeeping.
View all
Guides

Can you build your own invoice and bank statement extraction with Claude or Gemini? A 2026 guide for firms

Claude and Gemini APIs can read invoices and bank statements for cents. Here is what a DIY build must also handle, from splitting files to Xero posting, and when it is enough.
Saman Herath
November 30, 2026
Guides

How to split a multi-invoice PDF into separate bills in Xero and QuickBooks (2026)

Clients send one scanned PDF with a month of receipts. Here is how Dext, AutoEntry, Hubdoc, Xero and QuickBooks split it, and how to stop duplicate bills reaching Xero.
Saman Herath
November 30, 2026
Guides

InvoiceNow and PDF or paper invoices: what Singapore firms must do (2026)

IRAS confirms PDF and paper invoices cannot be converted to Peppol. Here is how solution-extracted submission works, who transmits, the phase dates and a checklist for firms.
Saman Herath
November 30, 2026

Start Saving Hours Each Week With AI Bookkeeping

Discover how Tofu automates bookkeeping workflows from invoice to ledger. Schedule your demo today.