# WritersLogic Recipe Scale API

> WritersLogic Recipe Scale API is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-18).

Scales up to 60 recipe or batch formula ingredient quantities by a servings ratio or factor, applying per-ingredient rules (linear, power, fixed), clamps, and rounding, with optional unit conversion.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/recipe-scale?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-recipe-scale-api-e4bf9fce
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MPeJ2Yc-LgSTSU98Rpp3E

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-recipe-scale-api-e4bf9fce -d '<json body>'
```

Example prompt: Scale my chocolate chip cookie recipe from 24 to 96 servings: flour 300g linear, sugar 200g linear, salt 5g fixed, baking soda 8g with power exponent 0.7, butter 220g linear with min 180g and max 500g. Round everything to 1g steps.

## When to prefer this

Use this endpoint when an AI agent needs programmatic, rule-driven ingredient scaling with explicit control over scaling laws (linear, power, fixed), clamping, and rounding — especially in meal prep, recipe apps, food manufacturing, or batch formulation contexts. It is ideal when the caller already knows which ingredients should scale non-linearly and can supply those rules, since no built-in culinary heuristics are applied. Prefer over manual computation when you need rounding drift reporting or unit conversion in the same call.

## Known failure modes

- Ingredient quantity rounds to zero — flagged in response so caller can adjust rounding step or min clamp
- Claimed quantity mismatch — if caller provides a 'claimed' field that doesn't match computed result, the ingredient is failed
- More than 60 ingredients submitted — request rejected
- Factor or toServings out of allowed range — validation error
- Density missing for a mass-to-volume unit conversion — conversion fails for that ingredient
- Invalid unit expression not parseable by unit-convert — error returned for affected ingredient

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

Returns each ingredient with its scaled quantity (and optionally unit-converted display quantity), plus a rounding report showing relative drift and any ingredient that rounded to zero. Ingredients are echoed with their original name and unit. Scaling failures (e.g. claimed-quantity mismatches) are flagged per ingredient.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "factor": {
   "type": "number",
   "maximum": 1000,
   "minimum": 0.001,
   "description": "Scale factor, instead of fromServings/toServings."
  },
  "density": {
   "type": "object",
   "required": [
    "value",
    "unit"
   ],
   "properties": {
    "unit": {
     "type": "string",
     "maxLength": 40,
     "description": "Mass per volume unit expression, e.g. g/mL, kg/m3, lb/ft3, oz/cup_us."
    },
    "value": {
     "type": "number",
     "maximum": 1000000000,
     "minimum": 1e-9,
     "description": "Caller-supplied mass per volume. Never looked up: no ingredient density table is shipped."
    }
   },
   "description": "Default density for displayUnit conversions that cross mass and volume.",
   "additionalProperties": false
  },
  "toServings": {
   "type": "number",
   "maximum": 1000000,
   "minimum": 0.000001,
   "description": "Servings wanted."
  },
  "ingredients": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "name",
     "quantity",
     "unit"
    ],
    "properties": {
     "max": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0,
      "description": "Upper clamp applied after the rule."
     },
     "min": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0,
      "description": "Lower clamp applied after the rule."
     },
     "name": {
      "type": "string",
      "maxLength": 80,
      "description": "Ingredient name, echoed back."
     },
     "rule": {
      "enum": [
       "linear",
       "power",
       "fixed"
      ],
      "type": "string",
      "description": "How the quantity scales. Default linear (quantity x factor): the labelled default, not a culinary claim. power: quantity x factor^exponent. fixed: stays at fixedQuantity (or the written quantity)."
     },
     "unit": {
      "type": "string",
      "maxLength": 40,
      "description": "Unit of the quantity: a unit-convert expression (g, cup_us, tbsp_metric) or any counted unit (egg, clove) that is only scaled, never converted."
     },
     "claimed": {
      "type": "number",
      "maximum": 1000000000000,
      "minimum": 0,
      "description": "Optional claimed scaled quantity (after rounding); a mismatch fails."
     },
     "density": {
      "type": "object",
      "required": [
       "value",
       "unit"
      ],
      "properties": {
       "unit": {
        "type": "string",
        "maxLength": 40,
        "description": "M
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-recipe-scale-api-e4bf9fce/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
