{
  "openapi": "3.1.0",
  "info": {
    "title": "Critical Minerals & Base Metals Concentrate Smelter TC/RC, Payable Metal, Royalty & Net Smelter Return (NSR) Calculator",
    "version": "1.0.0",
    "description": "Mining, Metals Trading & EV Raw-Materials FinOps / Copper/Zinc/Nickel/Lithium Concentrate TC/RC, Penalty Elements & NSR",
    "x-polar-products": {
      "portal_tiers": [
        {
          "sku_key": "mining_nsr_royalty_dataset",
          "product_id": "cbcbd7a6-4ea0-4752-a489-21843d6cd7ae",
          "name": "Concentrate Smelter NSR & Rents Dataset",
          "price_usd": null,
          "billing": "one_time",
          "checkout_url": "https://buy.polar.sh/polar_cl_DMfzQxKnRK8I6WeKfVAxCvV1b1LzPMRstmliy12ozvT"
        },
        {
          "sku_key": "concentrate_trader_pro_license",
          "product_id": "fce71e3b-8669-48dc-961d-c4a9aabc3f8d",
          "name": "Pro Concentrate Blending & QP API Key",
          "price_usd": null,
          "billing": "one_time",
          "checkout_url": "https://buy.polar.sh/polar_cl_oE7NcpquqPNOvilmUqZCqIkyido58I9zIitQ11T2c18"
        },
        {
          "sku_key": "mine_cfo_offtake_negotiation_pack",
          "product_id": "8ebb4fef-b596-49ee-af00-6cc2c345f223",
          "name": "Mining CFO & Offtake Desk NSR Pack",
          "price_usd": null,
          "billing": "one_time",
          "checkout_url": "https://buy.polar.sh/polar_cl_sYuWf3ybVdGrPeUHryVajqqsVcqx0eD2b28zY4C3PRv"
        }
      ],
      "master_all_portals_pass": {
        "master_all_portals_pro_monthly": {
          "product_id": "18e0b844-b764-41f0-9c3d-186362784997",
          "name": "All-Portals Master Pro API & Batch CSV License Key (Monthly)",
          "price_usd": 79,
          "billing": "monthly",
          "checkout_url": "https://buy.polar.sh/polar_cl_0P1axu2nXEDXECK8Z0k7I3sMndeo3hsdqpepv1LUcJT"
        },
        "enterprise_annual_data_pass": {
          "product_id": "8a5266eb-3aaf-4fb3-9aef-0e5bbfd17dc3",
          "name": "Annual Enterprise FinOps & Compliance Data Pass (All Portals)",
          "price_usd": 499,
          "billing": "yearly",
          "checkout_url": "https://buy.polar.sh/polar_cl_SPWfsAxuQAVHif3soxwqbq5zPAdNZFkN5CtQK3cZRft"
        }
      }
    }
  },
  "externalDocs": {
    "description": "AI-Agent & MCP Tool Discovery Catalog",
    "url": "https://p2-mining-tcrc-royalty-calc.pages.dev/agent-catalog.json"
  },
  "servers": [
    {
      "url": "https://p2-mining-tcrc-royalty-calc.pages.dev",
      "description": "Public static Pages dataset & discovery server"
    },
    {
      "url": "https://p2-core-api.evsmtoken.workers.dev",
      "description": "Authenticated P2 Core Pro API"
    }
  ],
  "paths": {
    "/data/meta.json": {
      "get": {
        "operationId": "getPortalMeta",
        "summary": "Get live dataset freshness metadata and upstream source list",
        "servers": [
          {
            "url": "https://p2-mining-tcrc-royalty-calc.pages.dev"
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata JSON with fetched_at, record_count, and sources",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsTxt",
        "summary": "Get LLM-readable portal summary and endpoint directory",
        "servers": [
          {
            "url": "https://p2-mining-tcrc-royalty-calc.pages.dev"
          }
        ],
        "responses": {
          "200": {
            "description": "Plain text discovery guide",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/license/verify": {
      "post": {
        "operationId": "verifyPolarLicense",
        "summary": "Verify a Polar.sh Pro License Key via p2-core-api",
        "servers": [
          {
            "url": "https://p2-core-api.evsmtoken.workers.dev"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key"
                ],
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "portal": {
                    "type": "string",
                    "default": "p2-mining-tcrc-royalty-calc"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "License verification result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/pro/p2-mining-tcrc-royalty-calc/dataset": {
      "get": {
        "operationId": "getProDataset",
        "summary": "Fetch authenticated full Pro JSON dataset for p2-mining-tcrc-royalty-calc",
        "servers": [
          {
            "url": "https://p2-core-api.evsmtoken.workers.dev"
          }
        ],
        "security": [
          {
            "PolarBearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Full Pro dataset JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Polar License Key"
          }
        }
      }
    },
    "/data/mineral-rents-and-tariffs.json": {
      "get": {
        "operationId": "getPublic_mineral_rents_and_tariffs_json",
        "summary": "Get public live open-data benchmark JSON (mineral-rents-and-tariffs.json)",
        "servers": [
          {
            "url": "https://p2-mining-tcrc-royalty-calc.pages.dev"
          }
        ],
        "responses": {
          "200": {
            "description": "Public benchmark dataset JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/data/mining-nsr-tcrc-matrix.json": {
      "get": {
        "operationId": "getPublic_mining_nsr_tcrc_matrix_json",
        "summary": "Get public live open-data benchmark JSON (mining-nsr-tcrc-matrix.json)",
        "servers": [
          {
            "url": "https://p2-mining-tcrc-royalty-calc.pages.dev"
          }
        ],
        "responses": {
          "200": {
            "description": "Public benchmark dataset JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "PolarBearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Polar License Key"
      }
    }
  }
}