{
  "openapi": "3.1.0",
  "info": {
    "title": "Snowflake Cost Check API",
    "version": "2026-11-10",
    "description": "The Snowflake Cost Check as an API: the same engine as the page. Send Account Usage query results for one account, get a report. Results are reported on in memory and dropped with the response. Nothing is stored or logged."
  },
  "servers": [
    {
      "url": "https://tools.finitizer.com"
    }
  ],
  "paths": {
    "/snowflake-cost-check/api": {
      "post": {
        "operationId": "runSnowflakeCostCheck",
        "summary": "Report on Snowflake Account Usage query results for one account.",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "markdown"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "results"
                ],
                "properties": {
                  "region": {
                    "type": "string",
                    "enum": [
                      "aws-us-east-1",
                      "aws-us-west-2",
                      "aws-eu-west-1",
                      "aws-eu-central-1",
                      "aws-ap-southeast-2",
                      "aws-ap-southeast-1",
                      "aws-ca-central-1",
                      "aws-us-east-2",
                      "aws-ap-northeast-1",
                      "aws-ap-south-1",
                      "aws-eu-west-2",
                      "aws-ap-northeast-2",
                      "aws-eu-north-1",
                      "aws-ap-northeast-3",
                      "aws-sa-east-1",
                      "aws-eu-west-3",
                      "aws-ap-southeast-3",
                      "aws-eu-central-2",
                      "aws-af-south-1",
                      "aws-ap-southeast-5",
                      "aws-ap-southeast-7",
                      "aws-ap-southeast-6",
                      "azure-eastus2",
                      "azure-westus2",
                      "azure-westeurope",
                      "azure-australiaeast",
                      "azure-canadacentral",
                      "azure-southeastasia",
                      "azure-switzerlandnorth",
                      "azure-centralus",
                      "azure-northeurope",
                      "azure-japaneast",
                      "azure-uaenorth",
                      "azure-southcentralus",
                      "azure-centralindia",
                      "azure-uksouth",
                      "azure-mexicocentral",
                      "azure-koreacentral",
                      "azure-swedencentral",
                      "azure-eastus",
                      "azure-eastasia",
                      "gcp-us-central1",
                      "gcp-us-east4",
                      "gcp-europe-west4",
                      "gcp-europe-west2",
                      "gcp-europe-west3",
                      "gcp-me-central2",
                      "gcp-australia-southeast2"
                    ],
                    "description": "The account's region, as listed or as CURRENT_REGION() returns it (AWS_US_EAST_1). Optional when results.bill states it."
                  },
                  "edition": {
                    "type": "string",
                    "enum": [
                      "standard",
                      "enterprise",
                      "businessCritical",
                      "vps"
                    ],
                    "default": "enterprise"
                  },
                  "creditPrice": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 100,
                    "description": "Your own price per credit in US dollars. Default: the list price for the region and edition."
                  },
                  "storagePerTb": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000,
                    "description": "Your own storage price per TB a month in US dollars. Default: the list price."
                  },
                  "results": {
                    "type": "object",
                    "additionalProperties": false,
                    "description": "Any of the five results. A missing result is reported as not provided, never as zero.",
                    "properties": {
                      "bill": {
                        "oneOf": [
                          {
                            "type": "string",
                            "description": "The result as text."
                          },
                          {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "text"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "base64": {
                                "type": "string",
                                "description": "The result, base64 encoded. Use this if a firewall refuses the text."
                              }
                            },
                            "required": [
                              "base64"
                            ]
                          }
                        ]
                      },
                      "warehouses": {
                        "oneOf": [
                          {
                            "type": "string",
                            "description": "The result as text."
                          },
                          {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "text"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "base64": {
                                "type": "string",
                                "description": "The result, base64 encoded. Use this if a firewall refuses the text."
                              }
                            },
                            "required": [
                              "base64"
                            ]
                          }
                        ]
                      },
                      "settings": {
                        "oneOf": [
                          {
                            "type": "string",
                            "description": "The result as text."
                          },
                          {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "text"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "base64": {
                                "type": "string",
                                "description": "The result, base64 encoded. Use this if a firewall refuses the text."
                              }
                            },
                            "required": [
                              "base64"
                            ]
                          }
                        ]
                      },
                      "storage": {
                        "oneOf": [
                          {
                            "type": "string",
                            "description": "The result as text."
                          },
                          {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "text"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "base64": {
                                "type": "string",
                                "description": "The result, base64 encoded. Use this if a firewall refuses the text."
                              }
                            },
                            "required": [
                              "base64"
                            ]
                          }
                        ]
                      },
                      "shapes": {
                        "oneOf": [
                          {
                            "type": "string",
                            "description": "The result as text."
                          },
                          {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "text"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "base64": {
                                "type": "string",
                                "description": "The result, base64 encoded. Use this if a firewall refuses the text."
                              }
                            },
                            "required": [
                              "base64"
                            ]
                          }
                        ]
                      }
                    }
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "json",
                      "markdown"
                    ],
                    "default": "json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The report. Fields are described in data.json."
          },
          "400": {
            "description": "The request is not valid."
          },
          "413": {
            "description": "Over 5000000 bytes."
          },
          "422": {
            "description": "No result could be read, or only query 3 was sent."
          },
          "429": {
            "description": "Over 20 reports a minute."
          }
        }
      }
    }
  }
}
