{"openapi":"3.1.0","info":{"title":"Thin Lens & Mirror API","version":"1.0.0","description":"Thin-lens and mirror imaging optics as an API, computed locally and deterministically. The lens endpoint applies the thin-lens equation, 1/f = 1/do + 1/di, and solves for whichever of the focal length, object distance or image distance you leave out, then returns the magnification m = −di/do and the full description of the image — real or virtual, upright or inverted, enlarged, reduced or the same size — and whether the lens is converging (convex, f > 0) or diverging (concave, f < 0). The mirror endpoint does the same for a spherical mirror, taking the focal length or the radius of curvature (f = R/2), classifying it as concave or convex and describing the image. The power endpoint converts between focal length in metres and optical power in diopters, D = 1/f, and combines several thin lenses placed in contact by adding their powers, D_total = ΣD, returning the combined focal length. Distances use whatever consistent unit you supply. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics and optics-education tools, lens and optical-system design, eyewear and vision apps, and photography learning. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is geometric-optics imaging; for Snell's-law refraction angles use a Snell API and for camera depth of field and field of view use a photography API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/lens-api","description":"oanor gateway"}],"tags":[{"name":"Optics"},{"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/lens":{"get":{"operationId":"get_v1_lens","tags":["Optics"],"summary":"Thin-lens equation","description":"","parameters":[{"name":"focal_length","in":"query","required":false,"description":"Focal length f (+ converging, − diverging)","schema":{"type":"string"},"example":"10"},{"name":"object_distance","in":"query","required":false,"description":"Object distance do","schema":{"type":"string"},"example":"30"},{"name":"image_distance","in":"query","required":false,"description":"Image distance di (provide two of three)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Real images form on the far side of the lens (di > 0); virtual images on the same side as the object.","formula":"1/f = 1/do + 1/di; m = −di/do.","lens_type":"converging (convex)","image_size":"reduced","image_type":"real","focal_length":10,"magnification":-0.5,"image_distance":15,"object_distance":30,"image_orientation":"inverted"},"meta":{"timestamp":"2026-06-04T10:18:47.018Z","request_id":"3f79f6fd-f59d-401b-aae7-39b914b6a074"},"status":"ok","message":"Thin-lens equation","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/mirror":{"get":{"operationId":"get_v1_mirror","tags":["Optics"],"summary":"Mirror equation","description":"","parameters":[{"name":"focal_length","in":"query","required":false,"description":"Focal length f (+ concave, − convex)","schema":{"type":"string"},"example":"10"},{"name":"radius_of_curvature","in":"query","required":false,"description":"Or radius of curvature R (f = R/2)","schema":{"type":"string"},"example":"20"},{"name":"object_distance","in":"query","required":false,"description":"Object distance do","schema":{"type":"string"},"example":"30"},{"name":"image_distance","in":"query","required":false,"description":"Image distance di","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Real images form in front of the mirror (di > 0); virtual images behind it.","formula":"1/f = 1/do + 1/di; f = R/2; m = −di/do.","image_size":"reduced","image_type":"real","mirror_type":"concave (converging)","focal_length":10,"magnification":-0.5,"image_distance":15,"object_distance":30,"image_orientation":"inverted","radius_of_curvature":20},"meta":{"timestamp":"2026-06-04T10:18:47.068Z","request_id":"01e3a1b2-1a11-48f4-b4bb-b967a4e27369"},"status":"ok","message":"Mirror equation","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/power":{"get":{"operationId":"get_v1_power","tags":["Optics"],"summary":"Lens power / diopters","description":"","parameters":[{"name":"focal_length_m","in":"query","required":false,"description":"Focal length in metres → power","schema":{"type":"string"},"example":"0.1"},{"name":"power","in":"query","required":false,"description":"Or power in diopters → focal length","schema":{"type":"string"}},{"name":"powers","in":"query","required":false,"description":"Or combine lenses in contact (e.g. 5,3)","schema":{"type":"string"}},{"name":"focal_lengths_m","in":"query","required":false,"description":"Or combine focal lengths in metres","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"mode":"focal_to_power","formula":"D = 1/f (f in metres).","focal_length_m":0.1,"power_diopters":10},"meta":{"timestamp":"2026-06-04T10:18:47.142Z","request_id":"c6cc9210-616d-4e48-a0d9-37c05762d500"},"status":"ok","message":"Lens power / diopters","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":"lens","note":"Thin-lens / mirror imaging (geometric optics) — computed locally and deterministically, no key, no third-party service.","endpoints":["/v1/lens","/v1/mirror","/v1/power","/v1/meta"]},"meta":{"timestamp":"2026-06-04T10:18:47.229Z","request_id":"230e8839-de8e-4340-9303-05aed91c022a"},"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":1501000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/lens-api"}