{"openapi":"3.1.0","info":{"title":"Herramientas Cobrables API","version":"1.0.0","description":"Small deterministic services for AI agents and automations, paid per request in USDC on Base.","contact":{"name":"Herramientas operativas","url":"https://herramientas-cobrables.consultoressasic.chatgpt.site"},"x-guidance":"Call a route without payment first. Read the HTTP 402 payment requirements, pay the exact amount in USDC on Base, then retry the same URL with a standard PAYMENT-SIGNATURE header."},"servers":[{"url":"https://herramientas-cobrables.consultoressasic.chatgpt.site"}],"paths":{"/api/paid/json-validate":{"get":{"operationId":"validateJsonContract","summary":"Validate a JSON object","description":"Validates a URL-encoded JSON object and reports missing required fields.","tags":["Verification"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"json":"{\"name\":\"Ada\"}","required":"name,email"}},"output":{"type":"json","example":{"ok":true,"result":{"valid":false,"isObject":true,"missing":["email"],"fields":["name"]},"transactionHash":"0x...","chargedUsd":"0.010000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"json":{"type":"string","minLength":2,"maxLength":50000},"required":{"type":"string","maxLength":500}},"required":["json"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","result"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"json","in":"query","required":true,"description":"URL-encoded JSON object, up to 50 KB.","schema":{"type":"string","minLength":2,"maxLength":50000,"example":"{\"name\":\"Ada\"}"}},{"name":"required","in":"query","required":false,"description":"Comma-separated field names to require.","schema":{"type":"string","example":"name,email"}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.010000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Validation result","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","result"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/margin-calculator":{"get":{"operationId":"calculateMarginAndBreakEven","summary":"Calculate margin and break-even","description":"Calculates gross profit, net profit, margins, break-even revenue and break-even units.","tags":["Finance"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"revenue":"1000","variable_costs":"400","fixed_costs":"300","units":"100"}},"output":{"type":"json","example":{"ok":true,"inputs":{"revenue":1000,"variableCosts":400,"fixedCosts":300,"units":100},"result":{"grossProfit":600,"netProfit":300,"grossMarginPct":60,"netMarginPct":30,"breakEvenRevenue":500,"breakEvenUnits":50},"transactionHash":"0x...","chargedUsd":"0.250000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"revenue":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"variable_costs":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"fixed_costs":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"units":{"type":"string","pattern":"^[1-9]\\d*$"}},"required":["revenue","variable_costs","fixed_costs","units"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"revenue","in":"query","required":true,"description":"Total revenue, greater than zero.","schema":{"type":"number","minimum":0.000001,"example":1000}},{"name":"variable_costs","in":"query","required":true,"description":"Total variable costs.","schema":{"type":"number","minimum":0,"example":400}},{"name":"fixed_costs","in":"query","required":true,"description":"Total fixed costs.","schema":{"type":"number","minimum":0,"example":300}},{"name":"units","in":"query","required":true,"description":"Units sold, a positive integer.","schema":{"type":"integer","minimum":1,"example":100}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.250000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Margin calculation","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/food-cost-calculator":{"get":{"operationId":"calculateFoodCost","summary":"Calculate food cost and waste-adjusted food cost","description":"Calculates food cost from beginning inventory, purchases, ending inventory and waste, then compares it with an optional target percentage.","tags":["Food operations"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"sales":"1000","beginning_inventory":"200","purchases":"450","ending_inventory":"180","waste_cost":"40","target_food_cost_pct":"35"}},"output":{"type":"json","example":{"ok":true,"inputs":{"sales":1000,"beginningInventory":200,"purchases":450,"endingInventory":180,"wasteCost":40,"targetFoodCostPct":35},"result":{"foodCostDollars":470,"adjustedFoodCostDollars":510,"foodCostPct":47,"adjustedFoodCostPct":51,"varianceToTargetPct":16,"withinTarget":false},"transactionHash":"0x...","chargedUsd":"0.250000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"sales":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"beginning_inventory":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"purchases":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"ending_inventory":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"waste_cost":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"target_food_cost_pct":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"}},"required":["sales","beginning_inventory","purchases","ending_inventory","waste_cost"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"sales","in":"query","required":true,"description":"Food sales for the period, greater than zero.","schema":{"type":"number","minimum":0.000001,"example":1000}},{"name":"beginning_inventory","in":"query","required":true,"description":"Beginning food inventory value.","schema":{"type":"number","minimum":0,"example":200}},{"name":"purchases","in":"query","required":true,"description":"Food purchases during the period.","schema":{"type":"number","minimum":0,"example":450}},{"name":"ending_inventory","in":"query","required":true,"description":"Ending food inventory value.","schema":{"type":"number","minimum":0,"example":180}},{"name":"waste_cost","in":"query","required":true,"description":"Recorded waste cost for the period.","schema":{"type":"number","minimum":0,"example":40}},{"name":"target_food_cost_pct","in":"query","required":false,"description":"Target food cost percentage; defaults to 35.","schema":{"type":"number","minimum":0.01,"maximum":100,"example":35}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.250000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Food cost calculation","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/labor-cost-calculator":{"get":{"operationId":"calculateLaborCost","summary":"Calculate restaurant labor cost","description":"Calculates loaded weekly payroll, labor cost percentage, target hours, and variance against a target.","tags":["Restaurant operations"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"sales":"6000","paid_hours":"210","hourly_wage":"14","payroll_burden_pct":"10","target_labor_cost_pct":"30"}},"output":{"type":"json","example":{"ok":true,"inputs":{"sales":6000,"paidHours":210,"hourlyWage":14,"payrollBurdenPct":10,"targetLaborCostPct":30},"result":{"weeklyPayroll":3234,"laborCostPct":53.9,"targetLaborDollars":1800,"targetHours":116.88,"hoursOverTarget":93.12,"varianceDollars":1434},"transactionHash":"0x...","chargedUsd":"0.250000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"sales":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"paid_hours":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"hourly_wage":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"payroll_burden_pct":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"target_labor_cost_pct":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"}},"required":["sales","paid_hours","hourly_wage","payroll_burden_pct","target_labor_cost_pct"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"sales","in":"query","required":true,"description":"Weekly sales, greater than zero.","schema":{"type":"number","minimum":0.000001,"example":6000}},{"name":"paid_hours","in":"query","required":true,"description":"Paid labor hours per week.","schema":{"type":"number","minimum":0,"example":210}},{"name":"hourly_wage","in":"query","required":true,"description":"Average hourly wage, greater than zero.","schema":{"type":"number","minimum":0.000001,"example":14}},{"name":"payroll_burden_pct","in":"query","required":true,"description":"Payroll burden percentage, from zero up to but not including 100.","schema":{"type":"number","minimum":0,"maximum":99.99,"example":10}},{"name":"target_labor_cost_pct","in":"query","required":true,"description":"Target labor cost percentage, greater than zero and below 100.","schema":{"type":"number","minimum":0.01,"maximum":99.99,"example":30}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.250000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Labor cost calculation","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/prime-cost-calculator":{"get":{"operationId":"calculatePrimeCost","summary":"Calculate restaurant prime cost","description":"Calculates combined food and loaded labor cost, separate percentages, and variance against a target.","tags":["Restaurant operations"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"sales":"6000","food_cost":"1800","labor_cost":"3234","target_prime_cost_pct":"60"}},"output":{"type":"json","example":{"ok":true,"inputs":{"sales":6000,"foodCost":1800,"laborCost":3234,"targetPrimeCostPct":60},"result":{"foodCostPct":30,"laborCostPct":53.9,"primeCostDollars":5034,"primeCostPct":83.9,"targetPrimeCostDollars":3600,"varianceDollars":1434},"transactionHash":"0x...","chargedUsd":"0.500000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"sales":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"food_cost":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"labor_cost":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"target_prime_cost_pct":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"}},"required":["sales","food_cost","labor_cost","target_prime_cost_pct"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"sales","in":"query","required":true,"description":"Weekly sales, greater than zero.","schema":{"type":"number","minimum":0.000001,"example":6000}},{"name":"food_cost","in":"query","required":true,"description":"Weekly food cost.","schema":{"type":"number","minimum":0,"example":1800}},{"name":"labor_cost","in":"query","required":true,"description":"Weekly loaded labor cost.","schema":{"type":"number","minimum":0,"example":3234}},{"name":"target_prime_cost_pct","in":"query","required":true,"description":"Target prime cost percentage, greater than zero and below 100.","schema":{"type":"number","minimum":0.01,"maximum":99.99,"example":60}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.500000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Prime cost calculation","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/menu-price-calculator":{"get":{"operationId":"calculateMenuPrice","summary":"Calculate a restaurant menu price","description":"Estimates a restaurant menu price from ingredient cost, target food cost percentage and an optional current price.","tags":["Restaurant operations"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"ingredient_cost":"4.25","target_food_cost_pct":"30","current_price":"12.95"}},"output":{"type":"json","example":{"ok":true,"inputs":{"ingredientCost":4.25,"targetFoodCostPct":30,"currentPrice":12.95},"result":{"ingredientCost":4.25,"targetFoodCostPct":30,"recommendedPrice":14.17,"recommendedContributionMargin":9.92,"currentPrice":12.95,"currentFoodCostPct":32.82,"currentContributionMargin":8.7,"priceGap":1.22},"transactionHash":"0x...","chargedUsd":"0.500000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"ingredient_cost":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"target_food_cost_pct":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"current_price":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"}},"required":["ingredient_cost","target_food_cost_pct"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"ingredient_cost","in":"query","required":true,"description":"Ingredient cost per menu item, greater than zero.","schema":{"type":"number","exclusiveMinimum":0,"example":4.25}},{"name":"target_food_cost_pct","in":"query","required":true,"description":"Target food cost percentage, greater than zero and below 100.","schema":{"type":"number","minimum":0.01,"maximum":99.99,"example":30}},{"name":"current_price","in":"query","required":false,"description":"Current menu price for comparison.","schema":{"type":"number","minimum":0,"example":12.95}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.500000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Menu price calculation","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/reorder-point-calculator":{"get":{"operationId":"calculateReorderPoint","summary":"Calculate a restaurant reorder point","description":"Calculates a reorder point from daily usage, supplier lead time, safety stock, and optional inventory.","tags":["Inventory operations"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"daily_usage":"12","lead_time_days":"3","safety_stock":"18","current_stock":"40","on_order":"0"}},"output":{"type":"json","example":{"ok":true,"inputs":{"dailyUsage":12,"leadTimeDays":3,"safetyStock":18,"currentStock":40,"onOrder":0},"result":{"dailyUsage":12,"leadTimeDays":3,"safetyStock":18,"reorderPoint":54,"currentStock":40,"onOrder":0,"availableStock":40,"stockGap":14,"needsReorder":true},"transactionHash":"0x...","chargedUsd":"0.250000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"daily_usage":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"lead_time_days":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"safety_stock":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"current_stock":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"on_order":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"}},"required":["daily_usage","lead_time_days","safety_stock"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"daily_usage","in":"query","required":true,"description":"Average daily usage, greater than zero.","schema":{"type":"number","exclusiveMinimum":0,"example":12}},{"name":"lead_time_days","in":"query","required":true,"description":"Supplier lead time in days.","schema":{"type":"number","minimum":0,"example":3}},{"name":"safety_stock","in":"query","required":true,"description":"Safety stock in the same unit as usage.","schema":{"type":"number","minimum":0,"example":18}},{"name":"current_stock","in":"query","required":false,"description":"Current stock in the same unit as usage.","schema":{"type":"number","minimum":0,"example":40}},{"name":"on_order","in":"query","required":false,"description":"Units already on order.","schema":{"type":"number","minimum":0,"example":0}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.250000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Reorder point calculation","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/waste-cost-calculator":{"get":{"operationId":"calculateWasteCost","summary":"Calculate restaurant waste cost","description":"Measures restaurant waste as a percentage of sales and compares it with a target and an optional previous period.","tags":["Food operations"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"sales":"1000","waste_cost":"40","target_waste_pct":"3","previous_waste_cost":"25"}},"output":{"type":"json","example":{"ok":true,"inputs":{"sales":1000,"wasteCost":40,"targetWastePct":3,"previousWasteCost":25},"result":{"wastePct":4,"targetWasteDollars":30,"varianceDollars":10,"variancePct":1,"potentialSavingsDollars":10,"previousWastePct":2.5,"changeDollars":15,"trend":"up","withinTarget":false},"transactionHash":"0x...","chargedUsd":"0.250000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"sales":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"waste_cost":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"target_waste_pct":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"previous_waste_cost":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"}},"required":["sales","waste_cost"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"sales","in":"query","required":true,"description":"Food sales for the period, greater than zero.","schema":{"type":"number","exclusiveMinimum":0,"example":1000}},{"name":"waste_cost","in":"query","required":true,"description":"Recorded waste cost for the period.","schema":{"type":"number","minimum":0,"example":40}},{"name":"target_waste_pct","in":"query","required":false,"description":"Target waste percentage; defaults to 3.","schema":{"type":"number","minimum":0,"maximum":100,"example":3}},{"name":"previous_waste_cost","in":"query","required":false,"description":"Waste cost from the previous comparable period.","schema":{"type":"number","minimum":0,"example":25}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.250000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Waste cost calculation","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/recipe-yield-calculator":{"get":{"operationId":"calculateRecipeYield","summary":"Calculate recipe yield and cost per portion","description":"Calculates portions per batch, cost per portion, and a target menu price from recipe yield and cost.","tags":["Restaurant operations"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"batch_cost":"42","total_yield":"3600","portion_size":"300","target_food_cost_pct":"30","current_price":"14.95"}},"output":{"type":"json","example":{"ok":true,"inputs":{"batchCost":42,"totalYield":3600,"portionSize":300,"targetFoodCostPct":30,"currentPrice":14.95},"result":{"portionsPerBatch":12,"costPerYieldUnit":0.01,"costPerPortion":3.5,"recommendedPrice":11.67,"recommendedContributionMargin":8.17,"currentFoodCostPct":23.41,"priceGap":-3.28},"transactionHash":"0x...","chargedUsd":"0.500000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"batch_cost":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"total_yield":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"portion_size":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"target_food_cost_pct":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"current_price":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"}},"required":["batch_cost","total_yield","portion_size","target_food_cost_pct"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"batch_cost","in":"query","required":true,"description":"Total cost of the batch, greater than zero.","schema":{"type":"number","exclusiveMinimum":0,"example":42}},{"name":"total_yield","in":"query","required":true,"description":"Usable batch yield in a consistent unit.","schema":{"type":"number","exclusiveMinimum":0,"example":3600}},{"name":"portion_size","in":"query","required":true,"description":"Portion size in the same unit as total yield.","schema":{"type":"number","exclusiveMinimum":0,"example":300}},{"name":"target_food_cost_pct","in":"query","required":true,"description":"Target food cost percentage, greater than zero and below 100.","schema":{"type":"number","minimum":0.01,"maximum":99.99,"example":30}},{"name":"current_price","in":"query","required":false,"description":"Current menu price for comparison.","schema":{"type":"number","minimum":0,"example":14.95}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.500000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Recipe yield calculation","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","result"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/stock-quote":{"get":{"operationId":"getPublicStockQuote","summary":"Get a public stock quote","description":"Returns a current public market quote, previous close, change and observed timestamp.","tags":["Finance"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"symbol":"AAPL"}},"output":{"type":"json","example":{"ok":true,"source":"public market data","symbol":"AAPL","currency":"USD","exchange":"NMS","price":200,"previousClose":199,"change":1,"changePct":0.5025,"observedAt":"2026-01-01T00:00:00.000Z","transactionHash":"0x...","chargedUsd":"0.050000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"symbol":{"type":"string","pattern":"^[A-Z0-9.^=-]{1,12}$"}},"required":["symbol"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"source":{"type":"string"},"symbol":{"type":"string"},"price":{"type":"number"},"previousClose":{"type":["number","null"]},"change":{"type":["number","null"]},"changePct":{"type":["number","null"]},"observedAt":{"type":["string","null"],"format":"date-time"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","source","symbol","price"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"symbol","in":"query","required":true,"description":"Ticker symbol such as AAPL or MSFT.","schema":{"type":"string","pattern":"^[A-Z0-9.^=-]{1,12}$","example":"AAPL"}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.050000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Public market quote","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"source":{"type":"string"},"symbol":{"type":"string"},"price":{"type":"number"},"previousClose":{"type":["number","null"]},"change":{"type":["number","null"]},"changePct":{"type":["number","null"]},"observedAt":{"type":["string","null"],"format":"date-time"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","source","symbol","price"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/x402-preflight":{"get":{"operationId":"preflightX402Endpoint","summary":"Check an x402 endpoint before paying","description":"Checks a public HTTPS endpoint for a valid x402 v2 HTTP 402 challenge, expected network and optional expected amount.","tags":["Verification"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"url":"https://example.com/api","expected_network":"eip155:8453","expected_amount_usd":"0.01"}},"output":{"type":"json","example":{"ok":true,"target":"https://example.com/api","result":{"ok":true,"status":402,"network":"eip155:8453","amountMicros":"10000","amountUsd":"0.010000","payTo":"0x..."},"transactionHash":"0x...","chargedUsd":"0.020000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"url":{"type":"string","format":"uri","pattern":"^https://"},"expected_network":{"type":"string","pattern":"^eip155:[0-9]+$"},"expected_amount_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$"}},"required":["url"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"target":{"type":"string","format":"uri"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","target","result"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"url","in":"query","required":true,"description":"Public HTTPS endpoint to inspect without sending payment.","schema":{"type":"string","format":"uri","pattern":"^https://","example":"https://example.com/api"}},{"name":"expected_network","in":"query","required":false,"description":"Expected CAIP-2 network, default eip155:8453.","schema":{"type":"string","pattern":"^eip155:[0-9]+$","example":"eip155:8453"}},{"name":"expected_amount_usd","in":"query","required":false,"description":"Optional expected decimal USD amount.","schema":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","example":"0.01"}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.020000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Preflight result","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"target":{"type":"string"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","target","result"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/seo-audit":{"get":{"operationId":"auditPublicSeo","summary":"Audit a public page for SEO basics","description":"Fetches a public HTTPS HTML page and returns deterministic metadata, heading, link, image-alt and text checks.","tags":["Verification"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"url":"https://example.com"}},"output":{"type":"json","example":{"ok":true,"target":"https://example.com","result":{"status":200,"title":"Example Domain","h1Count":1,"issues":[]},"transactionHash":"0x...","chargedUsd":"1.000000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"url":{"type":"string","format":"uri","pattern":"^https://"}},"required":["url"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"target":{"type":"string","format":"uri"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","target","result"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"url","in":"query","required":true,"description":"Public HTTPS page to inspect.","schema":{"type":"string","format":"uri","pattern":"^https://","example":"https://example.com"}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"1.000000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"SEO audit result","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"target":{"type":"string","format":"uri"},"result":{"type":"object"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","target","result"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/ops-plan":{"get":{"operationId":"generateThirtyDayOperatingPlan","summary":"Generate a 30-day operating plan","description":"Returns a deterministic operating plan and priorities from revenue, direct costs, fixed costs and units.","tags":["Operations"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{"revenue":"1000","variable_costs":"400","fixed_costs":"300","units":"100"}},"output":{"type":"json","example":{"ok":true,"inputs":{"revenue":1000,"variableCosts":400,"fixedCosts":300,"units":100},"summary":{"grossProfit":600,"netProfit":300,"grossMarginPct":60,"netMarginPct":30,"breakEvenRevenue":500,"breakEvenUnits":50},"priorities":["Review direct cost ratio","Review margin weekly"],"thirtyDayPlan":[{"period":"days_1_3","focus":"Baseline","action":"Define products and owners.","metric":"Definitions agreed"}],"transactionHash":"0x...","chargedUsd":"5.000000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{"revenue":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"variable_costs":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"fixed_costs":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"units":{"type":"string","pattern":"^[1-9]\\d*$"}},"required":["revenue","variable_costs","fixed_costs","units"],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"summary":{"type":"object"},"priorities":{"type":"array"},"thirtyDayPlan":{"type":"array"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","summary","priorities","thirtyDayPlan"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"parameters":[{"name":"revenue","in":"query","required":true,"description":"Total revenue, greater than zero.","schema":{"type":"number","minimum":0.000001,"example":1000}},{"name":"variable_costs","in":"query","required":true,"description":"Total variable costs.","schema":{"type":"number","minimum":0,"example":400}},{"name":"fixed_costs","in":"query","required":true,"description":"Total fixed costs.","schema":{"type":"number","minimum":0,"example":300}},{"name":"units","in":"query","required":true,"description":"Units sold, a positive integer.","schema":{"type":"integer","minimum":1,"example":100}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"5.000000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Thirty-day operating plan","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"inputs":{"type":"object"},"summary":{"type":"object"},"priorities":{"type":"array"},"thirtyDayPlan":{"type":"array"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","inputs","summary","priorities","thirtyDayPlan"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/complete-control-library":{"get":{"operationId":"downloadCompleteControlLibrary","summary":"Purchase the complete control library","description":"Returns an expiring protected download link after a successful x402 payment.","tags":["Digital products"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{}},"output":{"type":"json","example":{"ok":true,"productId":"complete-control-library","downloadUrl":"https://example.com/api/paid/complete-control-library/download?token=...","expiresAt":"2026-01-01T00:00:00.000Z","transactionHash":"0x...","chargedUsd":"149.000000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{},"required":[],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"productId":{"type":"string"},"downloadUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","productId","downloadUrl","expiresAt","transactionHash","chargedUsd"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"149.000000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Protected download link","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"productId":{"type":"string"},"productName":{"type":"string"},"downloadUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","productId","downloadUrl","expiresAt","transactionHash","chargedUsd"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}},"/api/paid/multi-location-control-license":{"get":{"operationId":"downloadMultiLocationControlLicense","summary":"Purchase the multi-location control license","description":"Returns an expiring protected download link for the complete operating library and a five-location license after a successful x402 payment.","tags":["Digital products"],"x-x402-extensions":{"bazaar":{"info":{"input":{"type":"http","method":"GET","queryParams":{}},"output":{"type":"json","example":{"ok":true,"productId":"multi-location-control-license","downloadUrl":"https://example.com/api/paid/multi-location-control-license/download?token=...","expiresAt":"2026-01-01T00:00:00.000Z","transactionHash":"0x...","chargedUsd":"399.000000"}}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"type":{"type":"string","const":"http"},"method":{"type":"string","enum":["GET"]},"queryParams":{"type":"object","properties":{},"required":[],"additionalProperties":false}},"required":["type","method"],"additionalProperties":false},"output":{"type":"object","properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","properties":{"ok":{"type":"boolean"},"productId":{"type":"string"},"downloadUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","productId","downloadUrl","expiresAt","transactionHash","chargedUsd"]}},"required":["type","example"],"additionalProperties":false}},"required":["input","output"],"additionalProperties":false}}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"399.000000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Protected download link","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"productId":{"type":"string"},"productName":{"type":"string"},"downloadUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"},"transactionHash":{"type":"string"},"chargedUsd":{"type":"string"}},"required":["ok","productId","downloadUrl","expiresAt","transactionHash","chargedUsd"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}}}}}