{"openapi":"3.1.0","info":{"title":"Half-Life Decay API","version":"1.0.0","description":"Radioactive (exponential) decay maths as an API, computed locally and deterministically. The decay endpoint computes how much of a substance remains after a given time, N(t) = N0·(1/2)^(t/T½) = N0·e^(−λt): from a half-life (or a decay constant or mean lifetime), an elapsed time and an optional initial amount, it returns the fraction and percent remaining, the remaining and decayed amounts, the number of half-lives elapsed, and — if you give an initial activity — the remaining activity, which decays by the same factor. The constant endpoint converts freely between the half-life T½, the decay constant λ = ln2/T½ and the mean lifetime τ = 1/λ = T½/ln2. The age endpoint reverses the decay to find the elapsed time from the fraction remaining, t = T½·log₂(1/fraction) — the basis of radiometric (carbon-14) dating — and accepts either a fraction or a remaining and initial amount. Time and half-life share one unit, and the results come out in that unit. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics and chemistry education, nuclear-medicine and dosimetry tools, archaeology and geology dating, and pharmacokinetics and science apps. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is exponential decay; for the ideal gas law use a gas-law API and for the chemical elements use an elements API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/halflife-api","description":"oanor gateway"}],"tags":[{"name":"Decay"},{"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/age":{"get":{"operationId":"get_v1_age","tags":["Decay"],"summary":"Age from remaining fraction","description":"","parameters":[{"name":"half_life","in":"query","required":false,"description":"Half-life T½ (or decay_constant)","schema":{"type":"string"},"example":"5730"},{"name":"decay_constant","in":"query","required":false,"description":"Or decay constant λ","schema":{"type":"string"}},{"name":"fraction_remaining","in":"query","required":false,"description":"Fraction remaining (0-1)","schema":{"type":"string"},"example":"0.25"},{"name":"remaining","in":"query","required":false,"description":"Or remaining amount (with initial)","schema":{"type":"string"}},{"name":"initial","in":"query","required":false,"description":"Initial amount","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"age":11460,"note":"Age comes out in the same time unit as the half-life. Basis of radiometric (e.g. carbon-14) dating.","formula":"t = T½ · log₂(1/fraction) = −ln(fraction) / λ.","half_life":5730,"decay_constant":0.0001209681,"percent_remaining":25,"fraction_remaining":0.25,"half_lives_elapsed":2},"meta":{"timestamp":"2026-06-04T01:59:02.303Z","request_id":"4f560efd-4936-43e7-8a3d-0ef2b79c0b66"},"status":"ok","message":"Age from remaining fraction","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/constant":{"get":{"operationId":"get_v1_constant","tags":["Decay"],"summary":"Half-life / decay constant / lifetime","description":"","parameters":[{"name":"half_life","in":"query","required":false,"description":"Half-life T½","schema":{"type":"string"},"example":"5730"},{"name":"decay_constant","in":"query","required":false,"description":"Or decay constant λ","schema":{"type":"string"}},{"name":"mean_lifetime","in":"query","required":false,"description":"Or mean lifetime τ","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"λ = ln2 / T½; mean lifetime τ = 1/λ = T½/ln2 ≈ 1.4427·T½.","source":"half_life","half_life":5730,"mean_lifetime":8266.64258429,"decay_constant":0.0001209681},"meta":{"timestamp":"2026-06-04T01:59:02.398Z","request_id":"cbeb1f43-a9dd-43e4-b8b6-3175b2e0c91e"},"status":"ok","message":"Half-life / decay constant / lifetime","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/decay":{"get":{"operationId":"get_v1_decay","tags":["Decay"],"summary":"Remaining amount after time","description":"","parameters":[{"name":"half_life","in":"query","required":false,"description":"Half-life T½ (or decay_constant)","schema":{"type":"string"},"example":"5730"},{"name":"decay_constant","in":"query","required":false,"description":"Or decay constant λ","schema":{"type":"string"}},{"name":"mean_lifetime","in":"query","required":false,"description":"Or mean lifetime τ","schema":{"type":"string"}},{"name":"time","in":"query","required":true,"description":"Elapsed time (same unit as T½)","schema":{"type":"string"},"example":"11460"},{"name":"initial","in":"query","required":false,"description":"Initial amount N0 (default 1)","schema":{"type":"string"},"example":"100"},{"name":"initial_activity","in":"query","required":false,"description":"Initial activity (optional)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Fraction remaining depends only on time/half-life. Activity decays by the same factor.","time":11460,"formula":"N(t) = N0 · (1/2)^(t/T½) = N0 · e^(−λt).","half_life":5730,"decay_constant":0.0001209681,"decayed_amount":75,"initial_amount":100,"remaining_amount":25,"percent_remaining":25,"fraction_remaining":0.25,"half_lives_elapsed":2},"meta":{"timestamp":"2026-06-04T01:59:02.497Z","request_id":"8fee1bc5-317e-4714-a774-8951cab143cd"},"status":"ok","message":"Remaining amount after time","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":{"api":"halflife","note":"Radioactive (exponential) decay maths — computed locally and deterministically, no key, no third-party service. Time and half-life share a unit.","endpoints":["/v1/decay","/v1/constant","/v1/age","/v1/meta"]},"meta":{"timestamp":"2026-06-04T01:59:02.580Z","request_id":"7665ad41-0fab-4a99-89a9-c2b674c8060a"},"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":3000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":500,"monthly_call_quota":40000,"rps_limit":5,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1500,"monthly_call_quota":250000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4900,"monthly_call_quota":1547000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/halflife-api"}