# GET /vat/calc: $0.001 per call

Invoice-ready VAT maths: add VAT to net amounts or take it out of gross ones, per line and in total, rounded to the penny the way HMRC allows, with the amounts formatted in the currency and locale you choose. Pass ?amounts=19.99,5.00&rate=20&mode=net&currency=GBP. Any rate (UK 20/5/0, EU rates) and 150+ currencies.

- **Price:** $0.001 in USDC, the same on Base, Solana, Polygon, Arbitrum. Failed calls are never charged.
- **Free trial:** yes, 20 free calls a day from Claude, Cursor or any MCP client ([set-up](/mcp/setup)).
- **Answers cached for:** not cached
- **Data sources:** computed locally
- **Lane:** Company financials & money ([OpenAPI](/openapi/finance.json))
- **Live health:** [status page](/status)

## Free sample

See an answer for the demo input first, free (no payment, 10 a minute): [https://aayatai.com/sample/vat-calc](/sample/vat-calc). It is a stored real answer when we have one, otherwise an example marked `"kind": "illustrative"`.

```bash
curl "https://aayatai.com/sample/vat-calc"
```

## 1. See the price (free)

Call it without paying: you get `402 Payment Required` and a `PAYMENT-REQUIRED` header with the exact price and where to pay.

```bash
curl -i "https://aayatai.com/vat/calc?amounts=19.99%2C5.00&rate=20&mode=net&rounding=line&currency=GBP&locale=en-GB"
```

## 2. Pay and call (TypeScript)

```bash
npm install @x402/fetch @x402/evm viem
```

```ts
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

// A wallet used only by your agent, holding a little USDC on Base.
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const res = await pay("https://aayatai.com/vat/calc?amounts=19.99%2C5.00&rate=20&mode=net&rounding=line&currency=GBP&locale=en-GB");
console.log(await res.json());
```

## 3. Or as an MCP tool

```ts
// MCP server: https://aayatai.com/mcp (Streamable HTTP). With the x402 MCP client (see /start):
const result = await client.callTool("vat-calc", {"amounts":"19.99,5.00","rate":20,"mode":"net","rounding":"line","currency":"GBP","locale":"en-GB"});
```

## Inputs

- `amounts` **(required)** (string): One amount or several invoice lines, comma-separated, e.g. 19.99,5.00.
- `rate` (number; default `20`): VAT rate in percent, e.g. 20 (UK standard), 5, 0, 19 (DE), 21 (NL).
- `mode` (string; one of `net`, `gross`; default `net`): net: amounts exclude VAT (add it); gross: amounts include VAT (take it out).
- `rounding` (string; one of `line`, `total`; default `line`): line: round VAT on each line then add (HMRC allows either); total: round once on the total.
- `currency` (string; default `GBP`): ISO currency code for formatting, e.g. GBP, EUR, USD, JPY.
- `locale` (string; default `en-GB`): Formatting locale, e.g. en-GB (default), de-DE, fr-FR.

Bad inputs are rejected with HTTP 400 before any payment is asked for.

## Example answer

Example only: the shape of an answer, with placeholder addresses and made-up figures. It is not data about any real token or wallet; call the service (or its free sample) for real results.

```json
{
  "mode": "net",
  "rate": 20,
  "currency": "GBP",
  "rounding": "line",
  "lines": [
    {
      "net": 19.99,
      "vat": 4,
      "gross": 23.99
    },
    {
      "net": 5,
      "vat": 1,
      "gross": 6
    }
  ],
  "totals": {
    "net": 24.99,
    "vat": 5,
    "gross": 29.99
  },
  "formatted": {
    "net": "£24.99",
    "vat": "£5.00",
    "gross": "£29.99"
  },
  "note": "VAT rounded to the nearest minor unit (half up) on each line, then added up."
}
```

## Related

- [GET /us/company/financials](/services/us-company-financials) ($0.01): Headline financials of any SEC-registered company by ticker, CIK or name, as filed: revenue, gross/operating/net income, EPS, assets, liabilities, equity, cash,
- [GET /us/company/filings](/services/us-company-filings) ($0.005): Latest SEC filings of any US-registered company by ticker, CIK or name: 10-K, 10-Q, 8-K (items spelled out, e.g.
- [GET /us/filings/search](/services/us-filings-search) ($0.005): Search the full text of SEC filings since 2001 for a word or "exact phrase": which companies mentioned it, in which 10-K, 10-Q, 8-K (items spelled out), S-1 or 
- [GET /convert/crypto](/services/crypto-convert) ($0.001): Convert between crypto and fiat at live rates: BTC, ETH, SOL, USDC and hundreds more against USD, GBP, EUR and 150+ currencies, either way, or crypto to crypto.
- [GET /iban/check](/services/iban-check) ($0.001): Validate an IBAN before you pay: check digits (mod-97), the right length for its country, SEPA membership, and the bank code, branch and account parts (UK: sort

New here? [Getting started in 60 seconds](/start). All services: [Aayat AI](/).