{"openapi":"3.1.0","info":{"title":"IndieML VES Inversion API","description":"1D Vertical Electrical Sounding (VES) Occam inversion API.","version":"1.0.0"},"paths":{"/health":{"get":{"summary":"Health Check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/invert":{"post":{"summary":"Run Inversion","operationId":"run_inversion_invert_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VESRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VESResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"VESRequest":{"properties":{"array_type":{"type":"string","enum":["schlumberger","wenner"],"title":"Array Type","default":"schlumberger"},"spacing":{"items":{"type":"number","maximum":1000000.0,"exclusiveMinimum":0.0},"type":"array","maxItems":150,"minItems":4,"title":"Spacing","description":"4 to 150 strictly positive spacings: AB/2 for Schlumberger, or 'a' spacing for Wenner (consistent length units, e.g. m or ft)"},"mn2":{"anyOf":[{"items":{"type":"number","maximum":1000000.0,"exclusiveMinimum":0.0},"type":"array","maxItems":150,"minItems":4},{"type":"null"}],"title":"Mn2","description":"Potential electrode half-spacing MN/2 (required for Schlumberger, must be > 0 and < AB/2; omitted for Wenner)"},"rhoa":{"items":{"type":"number","maximum":10000000.0,"exclusiveMinimum":0.0},"type":"array","maxItems":150,"minItems":4,"title":"Rhoa","description":"4 to 150 strictly positive apparent resistivity readings matching spacing length (consistent units, e.g. Ohm-m or Ohm-ft)"},"v_mV":{"anyOf":[{"items":{"type":"number","maximum":10000000.0,"minimum":-10000000.0},"type":"array","maxItems":150,"minItems":4},{"type":"null"}],"title":"V Mv","description":"Optional measured potential voltage in mV (used for QC weighting when sd_pct is omitted; flags < 10 mV)"},"i_mA":{"anyOf":[{"items":{"type":"number","maximum":10000000.0,"minimum":-10000000.0},"type":"array","maxItems":150,"minItems":4},{"type":"null"}],"title":"I Ma","description":"Optional injected current in mA (used for QC weighting when sd_pct is omitted; flags < 300 mA)"},"sd_pct":{"anyOf":[{"items":{"type":"number","maximum":100.0,"minimum":0.0},"type":"array","maxItems":150,"minItems":4},{"type":"null"}],"title":"Sd Pct","description":"Optional per-reading stacking standard deviation (%), clamped to a 2.0% minimum error floor to prevent singular weights"},"error_pct":{"type":"number","maximum":50.0,"minimum":0.1,"title":"Error Pct","description":"Fallback relative data error (%) applied uniformly when sd_pct is omitted","default":3.0},"lam":{"type":"number","maximum":1000.0,"minimum":0.1,"title":"Lam","description":"Occam regularization smoothing weight (lambda), used when auto_lam is false","default":20.0},"auto_lam":{"type":"boolean","title":"Auto Lam","description":"Select the smoothest candidate reaching chi2 <= 1.05 via discrepancy principle (overrides lam; falls back to the smoothest/best-fit candidate if target is not met)","default":false},"include_envelope":{"type":"boolean","title":"Include Envelope","description":"Compute min/max regularization sensitivity bounds by bracketing the selected lambda at 0.3x and 3.0x","default":false},"max_iter":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Max Iter","description":"Maximum Occam inversion iterations","default":20}},"type":"object","required":["spacing","rhoa"],"title":"VESRequest","examples":[{"ab2":[1.5,2.5,4.0,6.0,10.0,15.0,25.0,40.0,60.0,100.0],"array_type":"schlumberger","mn2":[0.5,0.5,0.5,1.0,1.0,2.0,2.0,5.0,5.0,10.0],"rhoa":[45.2,42.8,38.1,31.5,24.0,19.8,18.2,22.5,29.4,38.0]},{"a":[1,2,3,4,5,8,10,15,20,25,30,40],"array_type":"wenner","lam":20.0,"rhoa":[4.2,5.4,4.85,4.5,4.03,3.76,3.78,3.47,3.09,2.96,2.85,2.59],"sd_pct":[0.5,0.5,0.5,0.5,0.5,0.8,0.8,1.0,1.0,1.2,1.2,1.5]}]},"VESResponse":{"properties":{"ab2":{"items":{"type":"number"},"type":"array","title":"Ab2"},"mn2":{"items":{"type":"number"},"type":"array","title":"Mn2"},"rhoa_obs":{"items":{"type":"number"},"type":"array","title":"Rhoa Obs"},"rhoa_calc":{"items":{"type":"number"},"type":"array","title":"Rhoa Calc"},"depths":{"items":{"type":"number"},"type":"array","title":"Depths"},"resistivity":{"items":{"type":"number"},"type":"array","title":"Resistivity"},"resistivity_min":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Resistivity Min"},"resistivity_max":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Resistivity Max"},"step_depths":{"items":{"type":"number"},"type":"array","title":"Step Depths"},"step_resistivity":{"items":{"type":"number"},"type":"array","title":"Step Resistivity"},"step_resistivity_min":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Step Resistivity Min"},"step_resistivity_max":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Step Resistivity Max"},"doi_depth":{"type":"number","title":"Doi Depth"},"lam_used":{"type":"number","title":"Lam Used"},"rms_error_pct":{"type":"number","title":"Rms Error Pct"},"chi2":{"type":"number","title":"Chi2"},"qc_flags":{"items":{"type":"string"},"type":"array","title":"Qc Flags"}},"type":"object","required":["ab2","mn2","rhoa_obs","rhoa_calc","depths","resistivity","step_depths","step_resistivity","doi_depth","lam_used","rms_error_pct","chi2","qc_flags"],"title":"VESResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"servers":[{"url":"/ves/api"}]}