# Cheese Making API
> Cheese-making maths as an API, computed locally and deterministically — the yield and rennet numbers an artisan or home cheesemaker plans a make around. The yield endpoint applies the classic Van Slyke formula, yield % of milk = [(0.93 × fat) + (casein − 0.1)] × 1.09 / (1 − cheese moisture), from the milk fat, the casein (or true protein, since casein ≈ 0.78 × protein) and the target cheese moisture — whole milk at 3.5 % fat and 2.5 % casein making a 37 %-moisture cheddar yields about 9.78 % of the milk weight, so 100 litres gives roughly 10 kg of cheese and it takes about 9.9 litres of milk per kilogram. The rennet endpoint doses a milk volume to set: single-strength liquid rennet at roughly 0.2 ml per litre (double and triple strengths and tablets too), diluted about 20× in cool, non-chlorinated water before stirring in. Everything is computed locally and deterministically, so it is instant and private. Ideal for cheesemaking, dairy, creamery and artisan-food app developers, make-sheet and yield-planning tools, and dairy-science education. Pure local computation — no key, no third-party service, instant. Metric: litres, grams, percent. Live, nothing stored. 2 compute endpoints. Rennet strengths vary by product — confirm the label IMCU; a planning aid.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/cheese-api/..."
```

## Pricing
- **Free** (Free) — 6,750 calls/Mo, 2 req/s
- **Starter** ($3/Mo) — 64,000 calls/Mo, 6 req/s
- **Pro** ($9/Mo) — 254,000 calls/Mo, 15 req/s
- **Mega** ($28/Mo) — 1,450,000 calls/Mo, 40 req/s

## Endpoints

### Cheese

#### `GET /v1/rennet` — Rennet dose

**Parameters:**
- `milk_volume` (query, required, string) — Milk volume (litres) Example: `10`
- `form` (query, optional, string) — liquid-single/double/triple or tablet Example: `liquid-single`
- `ml_per_liter` (query, optional, string) — Override ml per litre
- `liters_per_tablet` (query, optional, string) — Litres per tablet (default 18)
- `dilution_ratio` (query, optional, string) — Dilution water × rennet (default 20)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cheese-api/v1/rennet?milk_volume=10&form=liquid-single"
```

**Response:**
```json
{
    "data": {
        "note": "Single-strength liquid rennet ≈ 0.2 ml per litre of milk; dilute ~20× in cool, non-chlorinated water before stirring in. Tablets ≈ 1 per 18 L. Always follow your rennet's label IMCU strength.",
        "inputs": {
            "form": "liquid-single",
            "milk_volume": 10
        },
        "rennet_ml": 2,
        "ml_per_liter": 0.2,
        "dilution_water_ml": 40
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:11.351Z",
        "request_id": "38cbf351-b26a-4d39-9e56-cb45e5cafa12"
    },
    "status": "ok",
    "message": "Rennet dose",
    "success": true
}
```

#### `GET /v1/yield` — Van Slyke cheese yield

**Parameters:**
- `fat_percent` (query, required, string) — Milk fat % Example: `3.5`
- `casein_percent` (query, optional, string) — Casein % (or protein_percent) Example: `2.5`
- `protein_percent` (query, optional, string) — True protein %
- `moisture_percent` (query, optional, string) — Cheese moisture % (default 37) Example: `37`
- `milk_volume` (query, optional, string) — Milk volume (litres) for kg yield Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cheese-api/v1/yield?fat_percent=3.5&casein_percent=2.5&moisture_percent=37&milk_volume=100"
```

**Response:**
```json
{
    "data": {
        "note": "Van Slyke yield % = [(0.93·fat) + (casein − 0.1)] × 1.09 / (1 − moisture). About 10 kg of cheddar per 100 kg of milk. Casein ≈ 0.78 × true protein.",
        "inputs": {
            "fat_percent": 3.5,
            "casein_percent": 2.5,
            "moisture_percent": 37
        },
        "yield_percent": 9.784,
        "milk_weight_kg": 103.2,
        "cheese_yield_kg": 10.097,
        "milk_volume_liters": 100,
        "milk_per_kg_cheese_liters": 9.9
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:11.444Z",
        "request_id": "e5922ef1-6b3a-40ed-8406-369f094468c3"
    },
    "status": "ok",
    "message": "Cheese yield",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cheese-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Metric: litres, grams, percent. Van Slyke uses casein (≈ 0.78 × true protein) and the target cheese moisture. Rennet strengths vary by product — confirm the label IMCU. A planning aid.",
        "service": "cheese-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/yield": "Cheese yield (Van Slyke) from milk fat, casein/protein and cheese moisture.",
            "GET /v1/rennet": "Rennet to set a milk volume (liquid strengths or tablets) with dilution water."
        },
        "description": "Cheese-making maths: Van Slyke cheese yield, rennet dosing and starter culture."
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:11.533Z",
        "request_id": "e733b8c7-444c-49c4-8802-33081a2b6a54"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/cheese-api
OpenAPI spec: https://www.oanor.com/api/cheese-api/openapi.json
