{"openapi":"3.1.0","info":{"title":"Tip Calculator API","version":"1.0.0","description":"Work out tips and split a bill — with exact cent maths so the per-person amounts always add back up to the total, no penny ever lost to rounding. The calc endpoint takes a bill, a tip percentage (15% by default) and a number of people and returns the tip amount, the grand total, the per-person amount, the effective tip percentage, and — when you want a tidy number — an optional rounding of the total either up to the next whole unit or to the nearest. When the bill does not divide evenly it produces a fair share list where a few people pay one cent more, so the parts sum precisely. The split endpoint divides any amount, optionally adding a tip first, evenly among people and returns that exact per-person share list. Everything is computed in integer cents locally and deterministically, so it is instant, private and always balances. Currency-agnostic — the numbers work for any currency. Ideal for restaurant and POS apps, expense-sharing and group-payment tools, delivery and service apps, and everyday bill splitting. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This calculates tips and splits; for percentage maths in general use a percentage API and for invoicing margins use a margin API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/tip-api","description":"oanor gateway"}],"tags":[{"name":"Tip"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/calc":{"get":{"operationId":"get_v1_calc","tags":["Tip"],"summary":"Calculate tip and total","description":"","parameters":[{"name":"bill","in":"query","required":true,"description":"The bill amount","schema":{"type":"string"},"example":"50"},{"name":"tip_percent","in":"query","required":false,"description":"Tip percentage (default 15)","schema":{"type":"string"},"example":"20"},{"name":"people","in":"query","required":false,"description":"Split between N people (default 1)","schema":{"type":"string"},"example":"3"},{"name":"round","in":"query","required":false,"description":"none (default), up or nearest","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"tip":10,"bill":50,"total":60,"people":3,"shares":[20,20,20],"rounding":"none","per_person":20,"tip_percent":20,"effective_tip_percent":20},"meta":{"timestamp":"2026-06-03T17:42:18.892Z","request_id":"9db84df4-bb56-4840-b015-d941e5e019b8"},"status":"ok","message":"Calculate tip and total","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/split":{"get":{"operationId":"get_v1_split","tags":["Tip"],"summary":"Split a bill evenly","description":"","parameters":[{"name":"amount","in":"query","required":true,"description":"The amount to split","schema":{"type":"string"},"example":"100"},{"name":"people","in":"query","required":false,"description":"Number of people (default 2)","schema":{"type":"string"},"example":"3"},{"name":"tip_percent","in":"query","required":false,"description":"Optional tip to add first (default 0)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"tip":0,"each":33.33,"even":false,"total":100,"amount":100,"people":3,"shares":[33.34,33.33,33.33],"tip_percent":0,"remainder_cents":1},"meta":{"timestamp":"2026-06-03T17:42:18.990Z","request_id":"ae8cae34-40cf-41b7-9a06-dafe1621e467"},"status":"ok","message":"Split a bill evenly","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"name":"Tip Calculator API","notes":"All maths is done in integer cents to avoid floating-point errors; the shares array always sums exactly to the total, with leftover cents given to the first people. Currency-agnostic — values are plain numbers. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/calc","params":{"bill":"the bill amount (required)","round":"none (default), up (round total up to a whole unit) or nearest","people":"split between N people (default 1)","tip_percent":"tip percentage (default 15)"},"returns":"the tip, total and per-person amounts"},{"path":"/v1/split","params":{"amount":"the amount to split (required)","people":"number of people (default 2)","tip_percent":"optional tip to add first (default 0)"},"returns":"an exact per-person share list that sums to the total"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Work out tips and split a bill — with exact cent maths, so the per-person amounts always add back up to the total. The calc endpoint takes a bill, a tip percentage (default 15%) and a number of people and returns the tip, the grand total, the per-person amount, the effective tip percent, and an optional rounding of the total (up to the next whole unit, or to the nearest). The split endpoint divides an amount (optionally adding a tip) evenly among people, distributing any leftover cents fairly so a few people pay one cent more rather than the totals being off by a penny. Pure local, no key."},"meta":{"timestamp":"2026-06-03T17:42:19.087Z","request_id":"91b94a8a-85f8-4577-baee-76489141651d"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":5035,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":655,"monthly_call_quota":14550,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2645,"monthly_call_quota":196500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6445,"monthly_call_quota":1025000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/tip-api"}