Catalog/tax-vat

Calculators

VAT / sales tax gross-up & extraction API

Add VAT/sales tax to a net amount (net x rate), or extract net + tax from a tax-inclusive gross amount (gross / (1 + rate)), returning net, tax, gross, and the rate. Deterministic gross-up math LLMs get wrong. Answers 'add 20% VAT to $100','what's the net of a tax-inclusive $120','extract sales tax from a total','VAT on this price'.

Price$0.01per request
MethodPOST
Route/v1/calc/tax-vat
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
taxvatsales-taxgstgross-upinclusiveexclusivecalc
API URLhttps://x402.hexl.dev/v1/calc/tax-vat
Integration docs
Example request
{
  "amount": 100,
  "rate": 0.2
}
Example response
{
  "mode": "exclusive",
  "net": 100,
  "tax": 20,
  "gross": 120,
  "rate": 0.2,
  "ratePercent": 20,
  "note": "Estimate. Added tax to a tax-exclusive net amount."
}
Input schema
{
  "type": "object",
  "required": [
    "amount",
    "rate"
  ],
  "properties": {
    "amount": {
      "type": "number",
      "description": "Net (exclusive) or gross (inclusive) amount in currency units",
      "examples": [
        100
      ]
    },
    "rate": {
      "type": "number",
      "description": "Tax rate as a decimal, e.g. 0.2 for 20%",
      "examples": [
        0.2
      ]
    },
    "inclusive": {
      "type": "boolean",
      "description": "True if amount already includes tax",
      "examples": [
        false
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}