{
  "openapi": "3.1.0",
  "info": {
    "title": "Custom Metrics Cost Check API",
    "version": "2026-11-21",
    "description": "The Custom Metrics Cost Check as an API: the same engine as the page. Send a metric list, as our CSV or the output of aws cloudwatch list-metrics --output json, and get series per metric and the monthly cost on Amazon CloudWatch, Google Cloud Monitoring and Datadog. The list is reported on in memory and dropped with the response. Nothing is stored or logged."
  },
  "servers": [
    {
      "url": "https://tools.finitizer.com"
    }
  ],
  "paths": {
    "/custom-metrics-cost-check/api": {
      "post": {
        "operationId": "runCustomMetricsCostCheck",
        "summary": "Series per metric and the monthly cost on CloudWatch, Google Cloud Monitoring and Datadog.",
        "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": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "description": "The list as text: our CSV, or the list-metrics JSON as a string."
                      },
                      {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "text"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "base64": {
                            "type": "string",
                            "description": "The list, base64 encoded. Use this if a firewall refuses the text."
                          }
                        },
                        "required": [
                          "base64"
                        ]
                      },
                      {
                        "type": "object",
                        "description": "The output of aws cloudwatch list-metrics --output json, as JSON.",
                        "properties": {
                          "Metrics": {
                            "type": "array"
                          }
                        },
                        "required": [
                          "Metrics"
                        ]
                      }
                    ]
                  },
                  "provider": {
                    "type": "string",
                    "enum": [
                      "cloudwatch",
                      "gcp",
                      "datadog"
                    ],
                    "default": "datadog",
                    "description": "The provider the report ranks by. All three are priced."
                  },
                  "region": {
                    "type": "string",
                    "enum": [
                      "us-east-1",
                      "us-west-2",
                      "ca-central-1",
                      "eu-west-1",
                      "eu-west-2",
                      "eu-central-1",
                      "ap-south-1",
                      "ap-southeast-1",
                      "ap-southeast-2",
                      "ap-northeast-1",
                      "sa-east-1"
                    ],
                    "default": "us-east-1"
                  },
                  "pointsPerMinute": {
                    "type": "number",
                    "minimum": 0.016666666666666666,
                    "maximum": 60,
                    "default": 1,
                    "description": "Google: points each series writes a minute. Cloud Monitoring takes at most 12, so the bytes path counts 12 above that and adds a note."
                  },
                  "gcpIngest": {
                    "type": "string",
                    "enum": [
                      "bytes",
                      "samples"
                    ],
                    "default": "bytes",
                    "description": "Google: Cloud Monitoring API and agents (bytes) or Managed Service for Prometheus (samples)."
                  },
                  "gcpBuckets": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 200,
                    "default": 10,
                    "description": "Google samples: non-zero buckets per distribution point."
                  },
                  "datadogPlan": {
                    "type": "string",
                    "enum": [
                      "annual",
                      "monthly",
                      "onDemand"
                    ],
                    "default": "annual"
                  },
                  "datadogSite": {
                    "type": "string",
                    "enum": [
                      "us",
                      "eu",
                      "ap1",
                      "ap2",
                      "uk1",
                      "us-fed"
                    ],
                    "default": "us"
                  },
                  "datadogTier": {
                    "type": "string",
                    "enum": [
                      "pro",
                      "enterprise"
                    ],
                    "default": "pro"
                  },
                  "hosts": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000,
                    "default": 0,
                    "description": "Datadog hosts, for the pooled allotment."
                  },
                  "datadogPercentiles": {
                    "type": "boolean",
                    "default": false
                  },
                  "change": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "tag",
                      "mode"
                    ],
                    "properties": {
                      "tag": {
                        "type": "string"
                      },
                      "mode": {
                        "type": "string",
                        "enum": [
                          "drop",
                          "bucket"
                        ]
                      },
                      "buckets": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1000000
                      }
                    }
                  },
                  "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 metric in the list could be read."
          },
          "429": {
            "description": "Over 20 reports a minute."
          }
        }
      }
    }
  }
}
