{"openapi":"3.1.0","info":{"title":"Special Relativity API","version":"1.0.0","description":"Special-relativity maths as an API, computed locally and deterministically. The lorentz endpoint computes the Lorentz factor γ = 1/√(1 − β²) from a velocity (in m/s, km/s or as a fraction of the speed of light β), and — given a proper time or a proper length — the dilated time Δt = γ·Δt₀ that a stationary observer measures and the contracted length L = L₀/γ. The energy endpoint computes the rest energy E₀ = mc², the total energy E = γmc², the kinetic energy KE = (γ − 1)mc² and the relativistic momentum p = γmv of a mass moving at a given speed, reporting the energies in both joules and electronvolts. The mass-energy endpoint applies Einstein's E = mc² to convert between mass and energy in either direction, in joules, electronvolts, megaelectronvolts and kilowatt-hours. The speed of light is exactly 299,792,458 m/s. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics-education, simulation, astronomy and science-communication app developers, relativity and particle-physics tools, and STEM teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is special relativity; for everyday SUVAT motion use a kinematics API and for orbital mechanics an orbital API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/relativity-api","description":"oanor gateway"}],"tags":[{"name":"Relativity"},{"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/energy":{"get":{"operationId":"get_v1_energy","tags":["Relativity"],"summary":"Relativistic energy","description":"","parameters":[{"name":"mass","in":"query","required":true,"description":"Rest mass (kg)","schema":{"type":"string"},"example":"1"},{"name":"beta","in":"query","required":false,"description":"Speed as a fraction of c","schema":{"type":"string"},"example":"0.8"},{"name":"velocity","in":"query","required":false,"description":"Or velocity (m/s)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"E₀ = mc² (rest), E = γmc² (total), KE = (γ−1)mc², p = γmv. At β = 0 this reduces to the rest energy.","inputs":{"beta":0.8,"mass_kg":1,"lorentz_factor":1.666666666667},"rest_energy_j":89875517900000000,"rest_energy_ev":5.6095886e+35,"total_energy_j":149792530000000000,"kinetic_energy_j":59917011900000000,"kinetic_energy_ev":3.73972574e+35,"relativistic_momentum_kg_ms":399723277},"meta":{"timestamp":"2026-06-04T18:38:05.278Z","request_id":"4b31538d-9ac0-4085-b13c-718a9701f3d6"},"status":"ok","message":"Relativistic energy","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/lorentz":{"get":{"operationId":"get_v1_lorentz","tags":["Relativity"],"summary":"Lorentz factor","description":"","parameters":[{"name":"beta","in":"query","required":false,"description":"Speed as a fraction of c (0–1)","schema":{"type":"string"},"example":"0.8"},{"name":"velocity","in":"query","required":false,"description":"Or velocity (m/s)","schema":{"type":"string"}},{"name":"velocity_kms","in":"query","required":false,"description":"Or velocity (km/s)","schema":{"type":"string"}},{"name":"proper_time","in":"query","required":false,"description":"Proper time (s) for dilation","schema":{"type":"string"},"example":"1"},{"name":"proper_length","in":"query","required":false,"description":"Proper length (m) for contraction","schema":{"type":"string"},"example":"1"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"beta":0.8,"note":"γ = 1/√(1−β²). Moving clocks run slow (Δt = γ·Δt₀); moving lengths contract (L = L₀/γ).","inputs":{"beta":0.8,"velocity_ms":239833966.4},"velocity_ms":239833966.4,"percent_of_c":80,"proper_time_s":1,"dilated_time_s":1.666666667,"lorentz_factor":1.666666666667,"proper_length_m":1,"contracted_length_m":0.6},"meta":{"timestamp":"2026-06-04T18:38:05.369Z","request_id":"5c1b9385-9cfc-43dd-9a2a-f95369750444"},"status":"ok","message":"Lorentz factor","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/mass-energy":{"get":{"operationId":"get_v1_mass_energy","tags":["Relativity"],"summary":"E = mc²","description":"","parameters":[{"name":"mass","in":"query","required":false,"description":"Mass (kg)","schema":{"type":"string"},"example":"1"},{"name":"energy","in":"query","required":false,"description":"Or energy (J)","schema":{"type":"string"}},{"name":"energy_ev","in":"query","required":false,"description":"Or energy (eV)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"E = mc² with c = 299,792,458 m/s. 1 kg ⇄ 8.98755×10¹⁶ J ≈ 24.97 billion kWh.","inputs":{"source":"mass"},"mass_kg":1,"energy_j":89875517900000000,"energy_ev":5.6095886e+35,"energy_kwh":24965421600,"energy_mev":5.6095885999999995e+29},"meta":{"timestamp":"2026-06-04T18:38:05.459Z","request_id":"87be3687-6ee8-45b5-a9e9-ea0d88655760"},"status":"ok","message":"Mass-energy","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":"c = 299,792,458 m/s. Velocity via 'velocity' (m/s), 'velocity_kms', or 'beta' (v/c); β must be < 1. Energies reported in J, eV and kWh.","service":"relativity-api","formulae":{"energy":"E = γmc², KE = (γ−1)mc², p = γmv","lorentz":"γ = 1/√(1 − β²), β = v/c","mass_energy":"E = mc²","time_dilation":"Δt = γ·Δt₀","length_contraction":"L = L₀/γ"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/energy":"Rest, total and kinetic energy and relativistic momentum from mass and velocity.","GET /v1/lorentz":"Lorentz factor from a velocity, with optional time dilation and length contraction.","GET /v1/mass-energy":"Convert between mass and energy via E = mc²."},"description":"Special-relativity calculator: Lorentz factor with time dilation and length contraction, relativistic energy and momentum, and mass–energy equivalence (E = mc²)."},"meta":{"timestamp":"2026-06-04T18:38:05.561Z","request_id":"07c7910f-9ae7-4ad9-a6cc-27924805dfce"},"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":2000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":500,"monthly_call_quota":20000,"rps_limit":5,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1500,"monthly_call_quota":150000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4900,"monthly_call_quota":1000000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/relativity-api"}