{
  "openapi": "3.1.0",
  "info": {
    "title": "Terraform Cost Estimator API",
    "version": "2026-11-04",
    "description": "Prices a Terraform plan, Terraform source or an Infracost breakdown at public list prices in US dollars. Free, with no account or key. The request is priced in memory and dropped with the response. Send exactly one of plan, infracost or files."
  },
  "servers": [
    {
      "url": "https://tools.finitizer.com"
    }
  ],
  "paths": {
    "/terraform-cost-estimator/api": {
      "post": {
        "operationId": "estimateTerraformCost",
        "summary": "Estimate the monthly cost of Terraform",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "plan": {
                    "description": "terraform show -json output, as an object or a string."
                  },
                  "infracost": {
                    "description": "infracost breakdown --format json output, as an object or a string."
                  },
                  "files": {
                    "type": "array",
                    "description": "Terraform files. A name may hold folders, so local modules resolve. A .tfvars file is refused.",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "text"
                      ],
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "text": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "variables": {
                    "type": "object",
                    "description": "Values for variables with no default.",
                    "additionalProperties": true
                  },
                  "region": {
                    "type": "string",
                    "description": "Fallback region, for resources whose region the input does not state."
                  },
                  "profile": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ],
                    "description": "A stated usage level for usage the input cannot state."
                  },
                  "usage": {
                    "type": "object",
                    "description": "Usage figures by key, from usageKey on a priced line.",
                    "additionalProperties": {
                      "type": "number"
                    }
                  },
                  "budget": {
                    "type": "number",
                    "description": "Monthly limit. Adds a verdict under policy."
                  },
                  "requiredTags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Tag keys every resource must carry. Adds a verdict under policy."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The estimate: the same JSON as Download JSON on the page. summary.monthlyUsd is the figure, summary.certainty says how far to trust it, lines are the priced items, unpriced and unmodelled say what was left out.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "413": {
            "description": "The request is over 5000000 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "The input could not be priced. The message says what to do instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait for the seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  }
}
