{
  "openapi": "3.1.0",
  "info": {
    "title": "GemsMakers Computational & Scientific Calculation API",
    "version": "1.0.0",
    "description": "Zero-auth, high-performance CORS-enabled REST API providing verified formulas for precious metals bullion melt, Archimedean specific gravity alloy matching, mechanical watch escapement timing, Euler-Bernoulli structural beam deflection, and chronostratigraphic index fossil biostratigraphy.",
    "termsOfService": "https://gemsmakers.com/terms.php",
    "contact": {
      "name": "GemsMakers API Team",
      "url": "https://gemsmakers.com/developers.php",
      "email": "gemsmakershub@gmail.com"
    },
    "license": {
      "name": "Creative Commons Attribution 4.0 International (CC-BY-4.0)",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://gemsmakers.com/api/v1",
      "description": "Production Global HTTPS Cluster"
    }
  ],
  "paths": {
    "/calculate.php": {
      "get": {
        "summary": "Execute Precision Scientific or Financial Calculation",
        "description": "Executes real-time mathematical calculations across 5 supported action modules.",
        "operationId": "calculate",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "description": "Calculation action to perform: bullion_melt, specific_gravity, watch_beat_math, beam_deflection, fossil_age_overlap",
            "schema": {
              "type": "string",
              "enum": [
                "bullion_melt",
                "specific_gravity",
                "watch_beat_math",
                "beam_deflection",
                "fossil_age_overlap"
              ]
            }
          },
          {
            "name": "weight_g",
            "in": "query",
            "required": false,
            "description": "Gross weight of precious metal in grams (required for bullion_melt)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "karat",
            "in": "query",
            "required": false,
            "description": "Gold karat (e.g. 10, 14, 18, 22, 24) (for bullion_melt)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "spot_per_oz",
            "in": "query",
            "required": false,
            "description": "Current spot price per troy ounce in USD (for bullion_melt)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "weight_air",
            "in": "query",
            "required": false,
            "description": "Weight of dry specimen in air in grams (for specific_gravity)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "weight_water",
            "in": "query",
            "required": false,
            "description": "Apparent submerged weight of specimen in water in grams (for specific_gravity)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "bph",
            "in": "query",
            "required": false,
            "description": "Watch movement beats per hour (e.g. 18000, 21600, 28800, 36000) (for watch_beat_math)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "lift_angle",
            "in": "query",
            "required": false,
            "description": "Balance wheel lift angle in degrees (default 52.0) (for watch_beat_math)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rate_sec_day",
            "in": "query",
            "required": false,
            "description": "Observed daily timing rate error in seconds per day (for watch_beat_math)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "load_n",
            "in": "query",
            "required": false,
            "description": "Uniformly distributed load in N/m (for beam_deflection)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "length_m",
            "in": "query",
            "required": false,
            "description": "Span length of beam in meters (for beam_deflection)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "elasticity_gpa",
            "in": "query",
            "required": false,
            "description": "Modulus of elasticity E in GPa (default 200.0 for structural steel) (for beam_deflection)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "inertia_cm4",
            "in": "query",
            "required": false,
            "description": "Second moment of area / Moment of inertia I_x in cm^4 (for beam_deflection)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "taxa",
            "in": "query",
            "required": false,
            "description": "Comma-separated list of index fossil species (for fossil_age_overlap)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful calculation result with formula breakdown and source tool link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "action": {
                      "type": "string",
                      "example": "bullion_melt"
                    },
                    "timestamp": {
                      "type": "string"
                    },
                    "inputs": {
                      "type": "object"
                    },
                    "results": {
                      "type": "object"
                    },
                    "source_tool_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation or missing parameter error"
          }
        }
      }
    }
  }
}