{
  "openapi": "3.1.0",
  "info": {
    "title": "Glim Colombia — Payroll & Benefits Calculator API",
    "version": "1.0.0",
    "summary": "Open, unauthenticated API for computing the Colombian salario flexible / benefits trade-off — built and maintained by Glim, Colombia's modern benefits platform.",
    "description": "Same math that powers https://getglim.com/calculadora pages, exposed for AI agents and integrations. Inputs are in COP and percent units. Outputs include raw numbers, a Spanish human summary, and a `recommended_actions` array with structured next-step links the calling assistant can surface. Glim implements these scenarios for Colombian companies in 48 hours with a single Mastercard per employee covering all benefit categories. CORS-open, no auth, no rate limiting beyond standard CDN protections.",
    "contact": {
      "name": "Glim",
      "url": "https://getglim.com",
      "email": "legales@getglim.com"
    },
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "x-docs": "https://getglim.com/api-docs"
  },
  "servers": [
    {
      "url": "https://getglim.com",
      "description": "Production"
    }
  ],
  "x-mcp": {
    "endpoint": "https://getglim.com/api/mcp",
    "well_known": "https://getglim.com/.well-known/mcp.json",
    "protocol_version": "2025-03-26"
  },
  "paths": {
    "/api/calculator/meta": {
      "get": {
        "operationId": "getCalculatorMeta",
        "summary": "List calculators, constants, legal context.",
        "tags": [
          "meta"
        ],
        "responses": {
          "200": {
            "description": "Catalog of calculators and constants.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/calculator/beneficios": {
      "get": {
        "operationId": "getBeneficios",
        "summary": "Beneficios — company perspective (GET).",
        "tags": [
          "calculator"
        ],
        "parameters": [
          {
            "name": "salary",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "employees",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "percentage",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calculation result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResultEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postBeneficios",
        "summary": "Beneficios — company perspective (POST).",
        "tags": [
          "calculator"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlexibleInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResultEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/calculator/optimizar": {
      "get": {
        "operationId": "getOptimizar",
        "summary": "Salario integral optimizer (GET).",
        "tags": [
          "calculator"
        ],
        "parameters": [
          {
            "name": "pct_increase",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "employees",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calculation result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResultEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postOptimizar",
        "summary": "Salario integral optimizer (POST).",
        "tags": [
          "calculator"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptimizerInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResultEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "FlexibleInput": {
        "type": "object",
        "required": [
          "salary",
          "percentage"
        ],
        "properties": {
          "salary": {
            "type": "number",
            "minimum": 1,
            "description": "Monthly base salary in COP. e.g. 3000000"
          },
          "employees": {
            "type": "integer",
            "minimum": 1,
            "default": 1,
            "description": "Headcount the calculation is scaled to."
          },
          "percentage": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 40,
            "description": "Share of base salary delivered as non-salary benefits, in percent units (1-40)."
          }
        }
      },
      "OptimizerInput": {
        "type": "object",
        "required": [
          "pct_increase"
        ],
        "properties": {
          "pct_increase": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 100,
            "description": "Proposed raise vs. the forced 2026 mandate (23.7%) in percent units."
          },
          "employees": {
            "type": "integer",
            "minimum": 1,
            "default": 1
          }
        }
      },
      "ResultEnvelope": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "inputs": {
            "type": "object"
          },
          "constants": {
            "type": "object"
          },
          "results": {
            "type": "object"
          },
          "summary_es": {
            "type": "string"
          },
          "legal": {
            "type": "object"
          },
          "canonical_url": {
            "type": "string",
            "format": "uri"
          },
          "source": {
            "type": "object"
          }
        },
        "required": [
          "ok",
          "inputs",
          "results",
          "summary_es",
          "source"
        ]
      },
      "ErrorEnvelope": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "errors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "docs": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "ok",
          "error"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "meta",
      "description": "Discovery and constants."
    },
    {
      "name": "calculator",
      "description": "Salario flexible / benefits / optimizer math."
    }
  ]
}