Tip Calculator API
Tip and total for a bill, split between people, optionally rounding each share up to a whole currency unit.
POST /api/v1/tools/tip-calculatorMCP tip_calculatorCalculatorsWork out the tip and total for a bill, split it between any number of people, and optionally round each share up to a whole amount.
Input
Send these as a JSON object. Unknown fields are rejected.
- bill
- Bill amount before tip (greater than 0). (number, 0 to …, required)
- tipPercent
- Tip in percent (0 to 100). (number, 0 to 100, default 15)
- people
- People splitting the bill (1 to 100). (integer, 1 to 100, default 1)
- roundUp
- Round each person's share up to the next whole unit; the extra goes to the tip. (boolean, default false)
curl https://pithlab.com/api/v1/tools/tip-calculator \n -H "Authorization: Bearer $PITHLAB_KEY" \n -H "Content-Type: application/json" \n -d '{"bill":84.5,"tipPercent":18,"people":3,"roundUp":true}'Example response
{
"ok": true,
"result": {
"bill": 84.5,
"people": 3,
"tip": 17.5,
"total": 102,
"perPerson": 34,
"tipPerPerson": 5.833333333333333,
"effectiveTipPercent": 20.710059171597635,
"roundedUp": true,
"text": "Bill 84.50 + tip 17.50 (20.71%) = 102.00; split 3 ways that's 34.00 each"
}
}