{"openapi":"3.1.0","info":{"title":"Textile Dyeing API","version":"1.0.0","description":"Textile-dyeing recipe maths as an API, computed locally and deterministically — the dye, water and auxiliary numbers a dyer weighs out to mix a repeatable dye-bath, whether for a swatch or a full bolt. The dye-weight endpoint gives the dye to weigh = the weight of fabric × the depth of shade, the percentage of dye on the weight of the goods: a 2 % shade on 100 g of fabric is 2 g of dye, pale shades run under half a percent, deep blacks 4 % or more — working on-weight-of-fabric is exactly what makes a recipe scale and repeat. The liquor-ratio endpoint gives the dye-bath volume = the weight of goods in kilos × the liquor ratio, the litres of bath per kilo (a 20:1 ratio is 20 L per kg); lower ratios save water, dye and energy and exhaust deeper, higher ratios level more evenly on delicate or pale work. The auxiliary endpoint gives the salt, soda ash or levelling agent to add = the bath volume × the dosing concentration in grams per litre — salt (50–80 g/L) drives reactive and direct dyes onto cotton, soda ash (10–20 g/L) raises the pH to fix them. Everything is on-weight or per-litre, so the same recipe gives the same colour and chemistry at any scale, and it is computed locally and deterministically, so it is instant and private. Ideal for craft and studio dyers, textile and yarn shops, and dye-recipe and batch-calculator tools. Pure local computation — no key, no third-party service, instant. 3 compute endpoints. For knitting yardage and gauge use a knitting API; for vegetable-ferment or meat-cure salt a fermentation or curing API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/dye-api","description":"oanor gateway"}],"tags":[{"name":"Dyeing"},{"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/auxiliary":{"get":{"operationId":"get_v1_auxiliary","tags":["Dyeing"],"summary":"Auxiliary amount from g/L","description":"","parameters":[{"name":"bath_volume_l","in":"query","required":true,"description":"Dye-bath volume (litres)","schema":{"type":"string"},"example":"5"},{"name":"concentration_g_per_l","in":"query","required":true,"description":"Dosing concentration (g/L)","schema":{"type":"string"},"example":"50"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Auxiliary amount = the bath volume × the dosing concentration in grams per litre — the way salt, soda ash, levelling agent and other auxiliaries are dosed. Salt (50–80 g/L) drives reactive and direct dyes onto cotton; soda ash (10–20 g/L) raises the pH to fix them. Because it is dosed per litre of bath, the same g/L gives the same chemistry at any scale once the bath volume is set from the liquor ratio.","inputs":{"bath_volume_l":5,"concentration_g_per_l":50},"auxiliary_g":250},"meta":{"timestamp":"2026-06-07T08:17:56.191Z","request_id":"c8397d10-eeaf-47f9-82db-a9f44cf6b8d5"},"status":"ok","message":"Auxiliary amount","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/dye-weight":{"get":{"operationId":"get_v1_dye_weight","tags":["Dyeing"],"summary":"Dye weight from depth of shade","description":"","parameters":[{"name":"fabric_weight_g","in":"query","required":true,"description":"Weight of fabric (g)","schema":{"type":"string"},"example":"250"},{"name":"depth_of_shade_pct","in":"query","required":true,"description":"Depth of shade (% on weight of fabric)","schema":{"type":"string"},"example":"1.5"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Dye weight = the weight of fabric (WOF) × the depth of shade, the percentage of dye on the weight of the goods. A 2 % shade on 100 g of fabric uses 2 g of dye; pale shades run under 0.5 %, deep blacks 4 % or more. Working on-weight-of-fabric is what makes a dye recipe scale and repeat — the same percentage gives the same colour whether you dye a swatch or a bolt.","inputs":{"fabric_weight_g":250,"depth_of_shade_pct":1.5},"dye_weight_g":3.75},"meta":{"timestamp":"2026-06-07T08:17:56.278Z","request_id":"1bc7a84e-20a3-40da-862a-fcbe813e38fb"},"status":"ok","message":"Dye weight","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/liquor-ratio":{"get":{"operationId":"get_v1_liquor_ratio","tags":["Dyeing"],"summary":"Bath volume from liquor ratio","description":"","parameters":[{"name":"fabric_weight_g","in":"query","required":true,"description":"Weight of fabric (g)","schema":{"type":"string"},"example":"250"},{"name":"liquor_ratio","in":"query","required":true,"description":"Liquor ratio (litres per kg, e.g. 20 = 20:1)","schema":{"type":"string"},"example":"20"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Bath volume = the weight of goods (in kg) × the liquor ratio, the litres of dye-bath per kilo of fabric — a 20:1 ratio is 20 L of water for every kg. Lower ratios (8–15:1) save water, dye and energy and exhaust deeper; higher ratios (20–40:1) level more evenly on delicate or pale work. The ratio sets how much auxiliary you then add at a given g/L (see /v1/auxiliary).","inputs":{"liquor_ratio":20,"fabric_weight_g":250},"bath_volume_l":5},"meta":{"timestamp":"2026-06-07T08:17:56.349Z","request_id":"7b8be088-653e-4666-94d3-25eea9a1d943"},"status":"ok","message":"Liquor ratio","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":{"notes":"Grams, litres, % on-weight-of-fabric. dye = WOF·shade%; bath_L = WOF_kg·ratio; auxiliary = bath_L·g/L. Recipes scale because everything is on-weight or per-litre. For fibre/yarn amounts use a knitting API.","service":"dye-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/auxiliary":"Salt/soda/auxiliary amount from bath volume and g/L.","GET /v1/dye-weight":"Dye weight from fabric weight and depth of shade.","GET /v1/liquor-ratio":"Dye-bath volume from fabric weight and liquor ratio."},"description":"Textile dyeing recipe maths: dye weight from depth of shade, bath volume from liquor ratio, and auxiliary amount from bath concentration."},"meta":{"timestamp":"2026-06-07T08:17:56.450Z","request_id":"6c4e8690-2704-4593-8120-62c46ae7d831"},"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":5500,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":690,"monthly_call_quota":52000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2340,"monthly_call_quota":215000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7200,"monthly_call_quota":980000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/dye-api"}