Invoice Check
by Invoice Math Checker in Markets & finance
Check a supplied invoice's line items, tax, and total. Use it when you need to know if the arithmetic balances. Buyer synonyms: invoice checker, invoice math, tax check, AP audit, bill verification. Unknown amounts are not treated as zero. No URL is fetched.
https://tgw-mindset-api.fly.dev/invoice-check- Price
- $0.01
- per call in USDC
- Uptime
- 97.2%
- last 30 days
- Response time
- 616 ms
- 692 ms slowest 5%
- Last check
- Passed
- 8 h ago, next any minute now
Reliability
Status and outage history · Atom feed · Watch with other listings
How to call it
POST https://tgw-mindset-api.fly.dev/invoice-check
Each call costs $0.01 in USDC on Base, paid with the request over x402.
Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.
Example request
From the listing.
POST https://tgw-mindset-api.fly.dev/invoice-check
content-type: application/json
{
"currency": "USD",
"line_items": [
{
"amount": "250.00",
"description": "Design workshop",
"id": "workshop"
},
{
"amount": "150.00",
"description": "Coaching session",
"id": "coaching",
"quantity": 2,
"unit_price": "75.00"
}
],
"subtotal": "400.00",
"tax": "32.00",
"tax_rate": "8%",
"text": "Invoice 1042\nDesign workshop $250.00\nCoaching session 2 x $75.00 $150.00\nSubtotal $400.00\nTax 8% $32.00\nTotal $432.00",
"total": "432.00"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
convert_to | string | No | Optional. Attach an ECB conversion of the known total. Arithmetic stays in the document currency. |
country | string | No | Optional. Attach a standard VAT reference. It is not applied to the tax check. |
currency | string | No | Reporting currency. Default USD. |
line_items | array of object | No | |
mode | string | No | The only mode. Fetch and search are rejected. One of: supplied_document. |
subtotal | string | No | |
tax | string | No | Tax amount. Use 0.00 only when the invoice states zero tax. |
tax_rate | string | No | Percent such as 8%, or a fraction such as 0.08. A bare 8 is not read as 8%. |
text | string | No | Invoice text already in hand. URLs in the text are not fetched. |
total | string | No |
Example response
The provider's example. We can't check it without paying.
Example response, 105 lines
{
"checks": [
{
"detail": "Each stated quantity times unit price matches its line amount.",
"id": "line_extensions",
"left": "150.00",
"right": "150.00",
"status": "match"
},
{
"detail": "2 line items sum to 400.00, matching the claimed subtotal.",
"id": "line_items_vs_subtotal",
"left": "400.00",
"right": "400.00",
"status": "match"
},
{
"detail": "Tax 32.00 matches 0.08 of the claimed subtotal 400.00.",
"id": "tax_vs_base",
"left": "32.00",
"right": "32.00",
"status": "match"
},
{
"detail": "Subtotal 400.00 plus tax 32.00 equals the claimed total 432.00.",
"id": "subtotal_plus_tax_vs_total",
"left": "432.00",
"right": "432.00",
"status": "match"
},
{
"detail": "Every stated currency is USD.",
"id": "currency_consistency",
"left": "USD",
"right": "USD",
"status": "match"
}
],
"claimed": {
"currency": "USD",
"subtotal": "400.00",
"tax": "32.00",
"tax_rate": "0.08",
"total": "432.00"
},
"computed": {
"base": "400.00",
"base_source": "claimed_subtotal",
"line_sum": "400.00",
"line_sum_complete": true,
"subtotal_plus_tax": "432.00",
"tax_on_base": "32.00"
},
"contract": "tgw-invoice-check-beta-1",
"currency": "USD",
"currency_consistent": true,
"disclaimer": "This check reads only the invoice you supplied. It does not fetch pages. Unknown amounts are not treated as zero.",
"evidence_scope": "supplied_document",
"extraction": "deterministic",
"limitations": [
"Only the invoice text and structured figures you supplied were read. No URL was fetched and no page was crawled.",
"A model may propose amounts from the supplied text. An amount is kept only when that amount appears in the text.",
"Checks are arithmetic on the supplied figures. An unknown or unreadable amount is not treated as zero.",
"A balanced or mismatch verdict uses those supplied figures. It is not tax, accounting, or legal advice, and it does not show that the invoice was paid."
],
"line_items": [
{
"amount": "250.00",
"currency": "USD",
"currency_explicit": false,
"description": "Design workshop",
"extension": null,
"extension_check": "not_applicable",
"id": "workshop",
"known": true,
"quantity": null,
"reason": null,
"source": "structured",
"span": null,
"unit_price": null
},
{
"amount": "150.00",
"currency": "USD",
"currency_explicit": false,
"description": "Coaching session",
"extension": "150.00",
"extension_check": "match",
"id": "coaching",
"known": true,
"quantity": "2",
"reason": null,
"source": "structured",
"span": null,
"unit_price": "75.00"
}
],
"mismatches": [],
"mode": "supplied_document",
"page_fetch": false,
"requested_currency": "USD",
"status": "ok",
"unknown_amounts": [],
"verdict": "balanced"
}Call it from code
The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.01.
curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://tgw-mindset-api.fly.dev/invoice-check' \
-H 'content-type: application/json' \
--data-raw '{"currency":"USD","line_items":[{"amount":"250.00","description":"Design workshop","id":"workshop"},{"amount":"150.00","description":"Coaching session","id":"coaching","quantity":2,"unit_price":"75.00"}],"subtotal":"400.00","tax":"32.00","tax_rate":"8%","text":"Invoice 1042\nDesign workshop $250.00\nCoaching session 2 x $75.00 $150.00\nSubtotal $400.00\nTax 8% $32.00\nTotal $432.00","total":"432.00"}'
# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://tgw-mindset-api.fly.dev/invoice-check' \
-H 'content-type: application/json' \
--data-raw '{"currency":"USD","line_items":[{"amount":"250.00","description":"Design workshop","id":"workshop"},{"amount":"150.00","description":"Coaching session","id":"coaching","quantity":2,"unit_price":"75.00"}],"subtotal":"400.00","tax":"32.00","tax_rate":"8%","text":"Invoice 1042\nDesign workshop $250.00\nCoaching session 2 x $75.00 $150.00\nSubtotal $400.00\nTax 8% $32.00\nTotal $432.00","total":"432.00"}' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
// Pays at most $0.01 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.01" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.01 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Ftgw-mindset-api.fly.dev%2Finvoice-check&method=POST
const res = await pay("https://tgw-mindset-api.fly.dev/invoice-check", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"currency": "USD",
"line_items": [
{
"amount": "250.00",
"description": "Design workshop",
"id": "workshop"
},
{
"amount": "150.00",
"description": "Coaching session",
"id": "coaching",
"quantity": 2,
"unit_price": "75.00"
}
],
"subtotal": "400.00",
"tax": "32.00",
"tax_rate": "8%",
"text": "Invoice 1042\nDesign workshop $250.00\nCoaching session 2 x $75.00 $150.00\nSubtotal $400.00\nTax 8% $32.00\nTotal $432.00",
"total": "432.00"
}),
});
console.log(res.status, await res.text());Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
# Pays at most $0.01 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.01"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))
with x402_requests(client) as session:
res = session.post(
"https://tgw-mindset-api.fly.dev/invoice-check",
json={
"currency": "USD",
"line_items": [
{
"amount": "250.00",
"description": "Design workshop",
"id": "workshop",
},
{
"amount": "150.00",
"description": "Coaching session",
"id": "coaching",
"quantity": 2,
"unit_price": "75.00",
},
],
"subtotal": "400.00",
"tax": "32.00",
"tax_rate": "8%",
"text": "Invoice 1042\nDesign workshop $250.00\nCoaching session 2 x $75.00 $150.00\nSubtotal $400.00\nTax 8% $32.00\nTotal $432.00",
"total": "432.00",
},
)
print(res.status_code, res.text)Security scan
No findings
We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 8 h ago | Passed | 402 | 656 ms | $0.01 |
| 18 h ago | Passed | 402 | 356 ms | $0.01 |
| 29 h ago | Passed | 402 | 407 ms | $0.01 |
| 41 h ago | Passed | 402 | 303 ms | $0.01 |
| 3 days ago | Timed out | - | - | - |
Show 10 older checks
| 5 days ago | Timed out | - | - | - |
| 5 days ago | Passed | 402 | 293 ms | $0.01 |
| 6 days ago | Passed | 402 | 337 ms | $0.01 |
| 6 days ago | Passed | 402 | 601 ms | $0.01 |
| 7 days ago | Passed | 402 | 554 ms | $0.01 |
| 7 days ago | Passed | 402 | 563 ms | $0.01 |
| 7 days ago | Passed | 402 | 676 ms | $0.01 |
| 8 days ago | Passed | 402 | 618 ms | $0.01 |
| 8 days ago | Passed | 402 | 381 ms | $0.01 |
| 8 days ago | Passed | 402 | 633 ms | $0.01 |
History
| 16 Nov 2026 | Price changed from $0.03 to $0.01 |