{"openapi":"3.1.0","info":{"title":"Scuba Diving API","version":"1.0.0","description":"Scuba-diving and gas-planning maths as an API, computed locally and deterministically. The nitrox endpoint takes an oxygen fraction and returns the maximum operating depth (MOD) for a ppO2 limit (1.4 working, 1.6 contingency), and, for a given depth, the oxygen partial pressure, the equivalent air depth (EAD), whether the mix is within its limit and the best mix for that depth — EAN32 has a MOD of 33.75 m at 1.4 and an EAD of 24.4 m at 30 m. The gas endpoint plans breathing gas from a surface air consumption (SAC/RMV) rate: it scales consumption to depth (consumption = SAC × (1 + depth/10)), gives the litres a planned dive needs and the cylinder duration on the available gas down to a reserve, and can derive your SAC from a logged dive's pressure drop, cylinder size and time. The pressure endpoint gives the ambient pressure and the partial pressure of every gas at depth, plus the equivalent narcotic depth (END) for any blend including trimix — helium is non-narcotic, so it cuts narcosis. Metric throughout: depth in metres of sea water, where 10 m ≈ 1 bar. Everything is computed locally and deterministically, so it is instant and private. Ideal for dive-planning, dive-log, freediving and scuba-training app developers, nitrox and trimix calculators, and dive-education tools. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. This is dive-planning maths, not a decompression-model NDL — always cross-check with tables or a dive computer.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/scuba-api","description":"oanor gateway"}],"tags":[{"name":"Scuba"},{"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/gas":{"get":{"operationId":"get_v1_gas","tags":["Scuba"],"summary":"Gas planning / SAC","description":"","parameters":[{"name":"depth","in":"query","required":true,"description":"Depth in metres","schema":{"type":"string"},"example":"20"},{"name":"sac","in":"query","required":false,"description":"Surface air consumption (L/min)","schema":{"type":"string"},"example":"20"},{"name":"time_min","in":"query","required":false,"description":"Planned bottom time (min)","schema":{"type":"string"},"example":"30"},{"name":"cylinder_liters","in":"query","required":false,"description":"Cylinder volume (L)","schema":{"type":"string"},"example":"12"},{"name":"start_bar","in":"query","required":false,"description":"Start pressure (bar)","schema":{"type":"string"},"example":"200"},{"name":"end_bar","in":"query","required":false,"description":"End pressure (bar, to derive SAC)","schema":{"type":"string"}},{"name":"reserve_bar","in":"query","required":false,"description":"Reserve pressure (bar)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Consumption at depth = SAC·(1+depth/10). Gas required = that × time. Duration = available gas ÷ consumption at depth. SAC can be derived from a logged dive.","inputs":{"depth":20,"time_min":30,"cylinder_liters":12},"derived_sac":false,"duration_min":40,"sac_liters_per_min":20,"gas_required_liters":1800,"ambient_pressure_ata":3,"available_gas_liters":2400,"consumption_liters_per_min_at_depth":60},"meta":{"timestamp":"2026-06-05T21:48:49.639Z","request_id":"474ab975-86f7-48d9-a044-0788ce37fdb6"},"status":"ok","message":"Gas planning","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/nitrox":{"get":{"operationId":"get_v1_nitrox","tags":["Scuba"],"summary":"Nitrox MOD, EAD, best mix","description":"","parameters":[{"name":"o2","in":"query","required":true,"description":"O2 fraction (0.32) or percent (32)","schema":{"type":"string"},"example":"32"},{"name":"depth","in":"query","required":false,"description":"Depth in metres (for EAD/ppO2/best mix)","schema":{"type":"string"},"example":"30"},{"name":"ppo2_max","in":"query","required":false,"description":"ppO2 limit (default 1.4)","schema":{"type":"string"},"example":"1.4"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"ppO2 = FO2·(1+depth/10). MOD is the depth where ppO2 hits the limit (1.4 working, 1.6 contingency). EAD matches the nitrox N2 partial pressure to an air depth.","inputs":{"o2":0.32,"depth":30,"ppo2_max":1.4},"ppn2_ata":2.72,"ppo2_ata":1.28,"ead_meters":24.43,"mod_meters":33.75,"o2_percent":32,"within_limit":true,"best_mix_o2_percent":35,"ambient_pressure_ata":4},"meta":{"timestamp":"2026-06-05T21:48:49.734Z","request_id":"8ef1f6e7-8b21-49fc-b3d5-32c13aa11e39"},"status":"ok","message":"Nitrox limits","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/pressure":{"get":{"operationId":"get_v1_pressure","tags":["Scuba"],"summary":"Partial pressures + END","description":"","parameters":[{"name":"depth","in":"query","required":true,"description":"Depth in metres","schema":{"type":"string"},"example":"40"},{"name":"o2","in":"query","required":false,"description":"O2 fraction/percent (default 0.21)","schema":{"type":"string"},"example":"0.21"},{"name":"he","in":"query","required":false,"description":"Helium fraction/percent (trimix)","schema":{"type":"string"},"example":"0"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Ambient pressure P = 1 + depth/10 (ata); each gas's partial pressure = fraction·P. END matches the N2 narcosis to an air depth — helium is non-narcotic, so a trimix lowers it.","inputs":{"he":0,"o2":0.21,"depth":40},"pphe_ata":0,"ppn2_ata":3.95,"ppo2_ata":1.05,"n2_fraction":0.79,"ambient_pressure_ata":5,"equivalent_narcotic_depth_meters":40},"meta":{"timestamp":"2026-06-05T21:48:49.836Z","request_id":"e91d8f76-09ea-42d2-bcde-977188cca88b"},"status":"ok","message":"Partial pressures","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":"Metric: depth in metres of sea water, 10 m ≈ 1 bar, P = 1 + depth/10 (ata). O2/He accepted as a fraction (0.32) or percent (32). This is dive-planning maths, not a decompression-model NDL — always cross-check with tables/a computer.","service":"scuba-api","endpoints":{"GET /v1/gas":"Gas consumption, requirement and cylinder duration from a SAC/RMV rate (or derive SAC from a logged dive).","GET /v1/meta":"This document.","GET /v1/nitrox":"MOD, EAD, ppO2 and best mix for a nitrox blend.","GET /v1/pressure":"Ambient pressure, partial pressures and equivalent narcotic depth for any mix (incl. trimix)."},"description":"Scuba-diving maths: nitrox limits (MOD, EAD, best mix, ppO2), gas planning (SAC consumption and cylinder duration) and partial pressures with equivalent narcotic depth."},"meta":{"timestamp":"2026-06-05T21:48:49.922Z","request_id":"03c4bb8c-c97c-4dc9-98a3-8ce3ebad2563"},"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":3750,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":460,"monthly_call_quota":44500,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1260,"monthly_call_quota":215000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":3950,"monthly_call_quota":1210000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/scuba-api"}