Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

Bill Splitter API

Split a restaurant bill item by item (tax and tip shared in proportion to what each person ate, to the cent) or settle group trip expenses with the fewest payments.

POST /api/v1/tools/bill-splitterMCP bill_splitterCalculators

Split a restaurant bill item by item with tax and tip shared fairly to the cent, or settle trip expenses with the fewest payments. Share the result as a link.

Input

Send these as a JSON object. Unknown fields are rejected.

mode
restaurant: split itemised bill. trip: who paid what, and who pays whom to settle up. (string, one of restaurant, trip, default "restaurant")
people
Comma-separated names of everyone splitting, 1 to 20 (at least 2 for trip), e.g. "Alice, Bob, Cara". Names must be distinct. (string, up to 2000 characters, required)
items
restaurant mode: JSON array of items, each {"name": string, "price": number, "sharedBy": [names or 0-based indexes]}. An empty or missing sharedBy means everyone shares it. Up to 100 items. (string, up to 50000 characters)
expenses
trip mode: JSON array of expenses, each {"description": string, "amount": number, "paidBy": name or 0-based index, "sharedBy": [names or indexes]}. Empty sharedBy means everyone. Up to 100 expenses. (string, up to 50000 characters)
tax
restaurant mode: tax, as a percentage of the item subtotal or a fixed amount (see taxKind). (number, 0 to …, default 0)
taxKind
Whether tax is a percent (0 to 100) or an amount. (string, one of percent, amount, default "percent")
tip
restaurant mode: tip, as a percentage of the item subtotal or a fixed amount (see tipKind). (number, 0 to …, default 0)
tipKind
Whether tip is a percent (0 to 100) or an amount. (string, one of percent, amount, default "percent")
curl https://pithlab.com/api/v1/tools/bill-splitter \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"mode":"restaurant","people":"Alice, Bob, Cara","items":"[{\"name\":\"Pizza\",\"price\":18},{\"name\":\"Pasta\",\"price\":14.5,\"sharedBy\":[\"Alice\"]},{\"name\":\"Salad\",\"price\":9.25,\"sharedBy\":[\"Bob\"]},{\"name\":\"Wine\",\"price\":24,\"sharedBy\":[\"Alice\",\"Cara\"]}]","tax":8,"tip":15}'
Example response
{
  "ok": true,
  "result": {
    "shares": [
      {
        "name": "Alice",
        "items": 32.5,
        "tax": 3.95,
        "tip": 7.41,
        "total": 43.86
      },
      {
        "name": "Bob",
        "items": 15.25,
        "tax": 1.86,
        "tip": 3.48,
        "total": 20.59
      },
      {
        "name": "Cara",
        "items": 18,
        "tax": 2.19,
        "tip": 4.11,
        "total": 24.3
      }
    ],
    "subtotal": 65.75,
    "tax": 8,
    "tip": 15,
    "total": 88.75,
    "text": "Alice: 43.86 (items 32.50 + tax 3.95 + tip 7.41)\nBob: 20.59 (items 15.25 + tax 1.86 + tip 3.48)\nCara: 24.30 (items 18.00 + tax 2.19 + tip 4.11)\nTotal: 88.75 (items 65.75 + tax 8.00 + tip 15.00)"
  }
}