{"openapi":"3.1.0","info":{"title":"Air-Fuel Ratio API","version":"1.0.0","description":"Air-fuel ratio and lambda maths for engine tuning as an API, computed locally and deterministically — the lambda, AFR and mixture numbers a tuner, ECU developer or motorsport engineer dials fuelling in with. The lambda endpoint turns a measured air-fuel ratio into lambda (the AFR divided by the fuel's stoichiometric AFR — 14.7 for gasoline) and the equivalence ratio φ = 1/lambda, classifying the mix as rich, stoichiometric or lean: a gasoline AFR of 13.0 is lambda 0.88, an 11.6 % rich mixture, the sort used at wide-open throttle for power and a cooler, safer burn. The afr endpoint runs it the other way — pick a target lambda and it gives the AFR the wideband should read — and because the AFR number is fuel-specific (E85's stoichiometric AFR is about 9.8, not 14.7) it always works from the right fuel, which is why pros tune in lambda when switching fuels. The mixture endpoint links the air the engine breathes to the fuel the injectors must add: give an air mass and a target lambda and it returns the fuel mass (or vice-versa), the heart of how an ECU sizes fuelling from measured airflow. Built-in stoichiometric ratios for gasoline, E10, E85, ethanol, methanol, diesel, LPG, propane, methane/CNG and hydrogen, or pass your own. Everything is computed locally and deterministically, so it is instant and private. Ideal for engine-tuning and dyno tools, ECU and standalone-management apps, motorsport and data-logging utilities. Pure local computation — no key, no third-party service, instant. 3 compute endpoints. For engine displacement and power use an engine API; for chemical reaction stoichiometry a stoichiometry API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/airfuel-api","description":"oanor gateway"}],"tags":[{"name":"AFR"},{"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/afr":{"get":{"operationId":"get_v1_afr","tags":["AFR"],"summary":"AFR from a target lambda","description":"","parameters":[{"name":"lambda","in":"query","required":true,"description":"Target lambda","schema":{"type":"string"},"example":"0.85"},{"name":"fuel","in":"query","required":false,"description":"Fuel (default gasoline)","schema":{"type":"string"},"example":"gasoline"},{"name":"stoich_afr","in":"query","required":false,"description":"Custom stoichiometric AFR override","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"afr":12.495,"note":"AFR = lambda × the stoichiometric AFR. Tuners pick a target lambda for each part of the map — around 0.85–0.90 (rich) at wide-open throttle for power and safety margin, near 1.00 for cruise and emissions — then convert to the AFR their wideband reads. Note the AFR number is fuel-specific (E85's stoichiometric AFR is ~9.8, not 14.7), so always tune in lambda when switching fuels.","inputs":{"fuel":"gasoline","lambda":0.85,"stoich_afr":14.7},"mixture":"rich (more fuel than stoichiometric)","equivalence_ratio_phi":1.1765},"meta":{"timestamp":"2026-06-06T23:53:51.652Z","request_id":"a15e76fc-4391-4093-afda-37a1ea90e2f7"},"status":"ok","message":"AFR","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/lambda":{"get":{"operationId":"get_v1_lambda","tags":["AFR"],"summary":"Lambda and φ from a measured AFR","description":"","parameters":[{"name":"afr","in":"query","required":true,"description":"Measured air-fuel ratio (by mass)","schema":{"type":"string"},"example":"13.0"},{"name":"fuel","in":"query","required":false,"description":"Fuel (default gasoline)","schema":{"type":"string"},"example":"gasoline"},{"name":"stoich_afr","in":"query","required":false,"description":"Custom stoichiometric AFR override","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Lambda = the measured air-fuel ratio ÷ the stoichiometric AFR for the fuel (14.7 for gasoline). Lambda 1.00 is the chemically correct mix; below 1 is rich (extra fuel — more power and cooler combustion, used at full throttle), above 1 is lean (more economical but hotter, risking knock and damage if overdone). The equivalence ratio φ is just 1/lambda, the way engine people often quote it.","inputs":{"afr":13,"fuel":"gasoline","stoich_afr":14.7},"lambda":0.8844,"mixture":"rich (more fuel than stoichiometric)","pct_from_stoich":-11.56,"equivalence_ratio_phi":1.1308},"meta":{"timestamp":"2026-06-06T23:53:51.757Z","request_id":"51e1db6a-9273-4e07-a080-a2ea38ff6fa2"},"status":"ok","message":"Lambda","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/mixture":{"get":{"operationId":"get_v1_mixture","tags":["AFR"],"summary":"Air or fuel mass for a mixture","description":"","parameters":[{"name":"lambda","in":"query","required":false,"description":"Target lambda (default 1)","schema":{"type":"string"},"example":"1.0"},{"name":"air_mass_g","in":"query","required":false,"description":"Air mass (g) — give this OR fuel","schema":{"type":"string"},"example":"1000"},{"name":"fuel_mass_g","in":"query","required":false,"description":"Fuel mass (g) — give this OR air","schema":{"type":"string"}},{"name":"fuel","in":"query","required":false,"description":"Fuel (default gasoline)","schema":{"type":"string"},"example":"gasoline"},{"name":"stoich_afr","in":"query","required":false,"description":"Custom stoichiometric AFR override","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"afr":14.7,"note":"At a chosen lambda the mixture has AFR = lambda × stoichiometric, so the fuel for a charge of air = air mass ÷ AFR (and air for a fuel mass = fuel × AFR). This links the air the engine breathes each cycle to the fuel the injectors must add — the heart of how an ECU and a tuner size injectors and set fuelling from the measured air mass.","inputs":{"fuel":"gasoline","lambda":1,"air_mass_g":1000,"stoich_afr":14.7},"fuel_mass_g":68.027},"meta":{"timestamp":"2026-06-06T23:53:51.843Z","request_id":"1043e0bb-f4d1-4a37-b868-802e164735cd"},"status":"ok","message":"Mixture","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":"Mass-based AFR (grams). lambda = AFR/stoich; φ = 1/lambda; AFR = lambda×stoich. Fuels: gasoline 14.7, E85 9.77, ethanol 9.0, methanol 6.47, diesel 14.5, LPG 15.6, methane 17.2, hydrogen 34.3 — or pass stoich_afr. For engine displacement/power use an engine API; for chemical stoichiometry a stoichiometry API.","service":"airfuel-api","endpoints":{"GET /v1/afr":"AFR from a target lambda.","GET /v1/meta":"This document.","GET /v1/lambda":"Lambda and equivalence ratio from a measured AFR.","GET /v1/mixture":"Air or fuel mass to complete a mixture at a target lambda."},"description":"Air-fuel ratio / lambda maths for engine tuning: lambda from AFR, AFR from lambda, and the air/fuel mass for a mixture."},"meta":{"timestamp":"2026-06-06T23:53:51.899Z","request_id":"f4327738-1ba2-4133-84e9-09b9cfbc0d8d"},"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":7100,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":910,"monthly_call_quota":75000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2980,"monthly_call_quota":312000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":9100,"monthly_call_quota":1480000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/airfuel-api"}