{"openapi":"3.1.0","info":{"title":"Unitprice API","version":"0.1.0","description":"A fully local price-per-unit / best-value calculator: true unit price across mass, volume and count units (US customary + metric), multi-option best-value ranking, general unit conversion, per-serving and per-use cost, discount-adjusted unit price, a reverse max-price-to-beat-a-target calculator, and a dedicated bulk-vs-single comparison. Pure arithmetic — no price lookup.\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://unitprice.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"hr@unifydynamics.com","url":"https://connectorbay.com/unitprice/docs"},"termsOfService":"https://connectorbay.com/unitprice/terms"},"servers":[{"url":"https://unitprice.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/unitprice/docs"},"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/unit_price":{"post":{"operationId":"unit_price","summary":"The true unit price for one item, broken down across every common display unit in its category (mass:","description":"The true unit price for one item, broken down across every common display unit in its category (mass:\n    per gram/100g/kg/oz/lb; volume: per ml/liter/fl oz/cup/gallon; count: per item/dozen). Use for \"what's the\n    price per ounce of a $5.99, 12oz jar\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"price":{"description":"Total price paid.","minimum":0,"title":"Price","type":"number"},"quantity":{"description":"How much you get for that price.","exclusiveMinimum":0,"title":"Quantity","type":"number"},"unit":{"description":"The unit quantity is measured in.","examples":["oz","lb","g","kg","ml","l","fl_oz","each","dozen"],"title":"Unit","type":"string"}},"required":["price","quantity","unit"],"title":"unit_priceArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/compare_unit_prices":{"post":{"operationId":"compare_unit_prices","summary":"Ranks 2 or more purchase options by true unit price — handling different pack sizes, brands and units","description":"Ranks 2 or more purchase options by true unit price — handling different pack sizes, brands and units\n    (oz vs lb vs g, or ml vs liter) automatically — and names the best value with percent-more-expensive for\n    every other option. Use for \"which is the better deal, a 16oz for $4 or a 32oz for $7?\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"options":{"description":"Each option: {label?, price, quantity, unit}. All options must be the same measurement category (all mass, all volume, or all count).","items":{"additionalProperties":true,"type":"object"},"maxItems":20,"minItems":2,"title":"Options","type":"array"}},"required":["options"],"title":"compare_unit_pricesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/convert_quantity":{"post":{"operationId":"convert_quantity","summary":"General mass/volume/count unit converter (oz/lb/g/kg, ml/l/fl_oz/cup/pint/quart/gallon, each/pair/dozen).","description":"General mass/volume/count unit converter (oz/lb/g/kg, ml/l/fl_oz/cup/pint/quart/gallon, each/pair/dozen).\n    Use for \"how many liters is 64 fl oz\", \"convert 2.5 lb to grams\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"value":{"description":"The numeric quantity to convert.","title":"Value","type":"number"},"from_unit":{"description":"Unit value is currently in.","title":"From Unit","type":"string"},"to_unit":{"description":"Unit to convert to.","title":"To Unit","type":"string"}},"required":["value","from_unit","to_unit"],"title":"convert_quantityArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/price_per_serving":{"post":{"operationId":"price_per_serving","summary":"Cost per serving/portion, plus how much product each serving is. Use for \"if a $6 box has 8 servings,","description":"Cost per serving/portion, plus how much product each serving is. Use for \"if a $6 box has 8 servings,\n    what's the cost per serving\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"price":{"description":"Total price paid.","minimum":0,"title":"Price","type":"number"},"quantity":{"description":"Total quantity in the package.","exclusiveMinimum":0,"title":"Quantity","type":"number"},"unit":{"description":"Unit quantity is measured in (for context in the result).","title":"Unit","type":"string"},"servings":{"description":"Number of servings/portions in the package.","exclusiveMinimum":0,"title":"Servings","type":"number"}},"required":["price","quantity","unit","servings"],"title":"price_per_servingArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/discount_adjusted_unit_price":{"post":{"operationId":"discount_adjusted_unit_price","summary":"The effective unit price after applying a percent-off or flat-dollar discount. Use for \"this $10 item is","description":"The effective unit price after applying a percent-off or flat-dollar discount. Use for \"this $10 item is\n    20% off, what's the real price per unit\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"price":{"description":"The original (pre-discount) price.","minimum":0,"title":"Price","type":"number"},"quantity":{"description":"How much you get for that price.","exclusiveMinimum":0,"title":"Quantity","type":"number"},"unit":{"description":"The unit quantity is measured in.","title":"Unit","type":"string"},"discount_percent":{"anyOf":[{"maximum":100,"minimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Discount as a percent, e.g. 20 for 20% off. Provide this or discount_amount, not both.","title":"Discount Percent"},"discount_amount":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Discount as a flat dollar amount. Provide this or discount_percent, not both.","title":"Discount Amount"}},"required":["price","quantity","unit"],"title":"discount_adjusted_unit_priceArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/max_price_to_beat_target":{"post":{"operationId":"max_price_to_beat_target","summary":"Works backwards from a target unit price: the most you should pay in total for a given quantity to stay","description":"Works backwards from a target unit price: the most you should pay in total for a given quantity to stay\n    at or under that per-unit price. Use for \"I don't want to pay more than $0.10/oz — what's the most I should\n    pay for a 40oz bag\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"target_unit_price":{"description":"The unit price you're trying to beat.","exclusiveMinimum":0,"title":"Target Unit Price","type":"number"},"target_unit":{"description":"Unit the target price is quoted in.","title":"Target Unit","type":"string"},"quantity":{"description":"How much you're considering buying.","exclusiveMinimum":0,"title":"Quantity","type":"number"},"quantity_unit":{"description":"Unit the quantity is measured in — same category as target_unit.","title":"Quantity Unit","type":"string"}},"required":["target_unit_price","target_unit","quantity","quantity_unit"],"title":"max_price_to_beat_targetArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/bulk_vs_single_savings":{"post":{"operationId":"bulk_vs_single_savings","summary":"A dedicated bulk-vs-single comparison: which is the better unit price, how many singles it'd take to","description":"A dedicated bulk-vs-single comparison: which is the better unit price, how many singles it'd take to\n    match the bulk quantity, what that would cost, and how much buying bulk actually saves. Use for \"is the\n    family-size pack actually cheaper than buying the regular size three times\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"bulk_price":{"description":"Price of the bulk/larger option.","minimum":0,"title":"Bulk Price","type":"number"},"bulk_quantity":{"description":"Quantity of the bulk option.","exclusiveMinimum":0,"title":"Bulk Quantity","type":"number"},"bulk_unit":{"description":"Unit the bulk quantity is measured in.","title":"Bulk Unit","type":"string"},"single_price":{"description":"Price of the single/smaller option.","minimum":0,"title":"Single Price","type":"number"},"single_quantity":{"description":"Quantity of the single option.","exclusiveMinimum":0,"title":"Single Quantity","type":"number"},"single_unit":{"description":"Unit the single quantity is measured in — same category as bulk_unit.","title":"Single Unit","type":"string"}},"required":["bulk_price","bulk_quantity","bulk_unit","single_price","single_quantity","single_unit"],"title":"bulk_vs_single_savingsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/cost_per_use":{"post":{"operationId":"cost_per_use","summary":"Simple cost-per-use (or cost-per-wear), for comparing a cheap item you'll use a few times against a","description":"Simple cost-per-use (or cost-per-wear), for comparing a cheap item you'll use a few times against a\n    pricier, more durable one. Use for \"a $120 pair of shoes I'll wear 200 times vs a $40 pair I'll wear 30\n    times, which is the better value per use\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"price":{"description":"Total price paid.","minimum":0,"title":"Price","type":"number"},"expected_uses":{"description":"How many times you expect to use it.","exclusiveMinimum":0,"title":"Expected Uses","type":"number"}},"required":["price","expected_uses"],"title":"cost_per_useArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/supported_units":{"post":{"operationId":"supported_units","summary":"Every unit and measurement category (mass, volume, count) this calculator understands. Use for \"what","description":"Every unit and measurement category (mass, volume, count) this calculator understands. Use for \"what\n    units can you convert between\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"supported_unitsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}