{
  "openapi": "3.0.1",
  "info": {
    "title": "API Health Checker",
    "description": "Monitor API endpoints with health scoring (0-100), performance ratings, and actionable insights. Checks availability, latency, and response validation. Retry logic with exponential backoff. Get recommendations for slow or failing endpoints. Perfect for uptime monitoring and SLA verification.",
    "version": "1.2",
    "x-build-id": "PPTrLI9cTKkN1j2tF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wheat_tourist~api-health-checker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wheat_tourist-api-health-checker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/wheat_tourist~api-health-checker/runs": {
      "post": {
        "operationId": "runs-sync-wheat_tourist-api-health-checker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/wheat_tourist~api-health-checker/run-sync": {
      "post": {
        "operationId": "run-sync-wheat_tourist-api-health-checker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "endpoints"
        ],
        "properties": {
          "endpoints": {
            "title": "Endpoints",
            "minItems": 1,
            "type": "array",
            "description": "List of API endpoints to check for health",
            "items": {
              "type": "object",
              "required": [
                "name",
                "url"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "title": "Name",
                  "description": "A friendly identifier for logs and reports"
                },
                "url": {
                  "type": "string",
                  "title": "URL",
                  "description": "Full URL with protocol (http:// or https://)",
                  "pattern": "^https?://.+"
                },
                "method": {
                  "type": "string",
                  "title": "HTTP Method",
                  "description": "HTTP method for the request",
                  "default": "GET",
                  "enum": [
                    "GET",
                    "POST",
                    "PUT",
                    "PATCH",
                    "DELETE",
                    "HEAD",
                    "OPTIONS"
                  ]
                },
                "expectedStatus": {
                  "type": "integer",
                  "title": "Expected Status",
                  "description": "HTTP status code indicating healthy response",
                  "default": 200,
                  "minimum": 100,
                  "maximum": 599
                },
                "timeoutMs": {
                  "type": "integer",
                  "title": "Timeout (ms)",
                  "description": "Maximum time to wait for response",
                  "default": 10000,
                  "minimum": 100,
                  "maximum": 300000
                },
                "maxLatencyMs": {
                  "type": "integer",
                  "title": "Max Latency (ms)",
                  "description": "Latency threshold - exceeding this marks endpoint as slow",
                  "default": 2000,
                  "minimum": 1
                },
                "headers": {
                  "type": "object",
                  "title": "Headers",
                  "description": "Custom headers. Use {{VAR}} for env variables",
                  "default": {},
                  "editor": "json"
                },
                "body": {
                  "type": "object",
                  "title": "Body",
                  "description": "JSON body for POST/PUT/PATCH requests",
                  "editor": "json"
                },
                "validateJsonKeys": {
                  "type": "array",
                  "title": "Validate Keys",
                  "description": "Required JSON keys in response body",
                  "default": [],
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "retryCount": {
            "title": "Retry Count",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries for transient failures (exponential backoff)",
            "default": 3
          },
          "notifyOnFailure": {
            "title": "Notify on Failure",
            "type": "boolean",
            "description": "Log detailed notifications for unhealthy/degraded endpoints",
            "default": false
          },
          "performanceThresholds": {
            "title": "Performance Thresholds",
            "type": "object",
            "description": "Custom latency thresholds for performance rating",
            "properties": {
              "fastMs": {
                "type": "integer",
                "title": "Fast Threshold (ms)",
                "description": "Latency below this is rated 'fast'",
                "default": 500,
                "minimum": 1
              },
              "acceptableMs": {
                "type": "integer",
                "title": "Acceptable Threshold (ms)",
                "description": "Latency below this is rated 'acceptable'",
                "default": 2000,
                "minimum": 1
              }
            }
          },
          "scoringWeights": {
            "title": "Scoring Weights",
            "type": "object",
            "description": "Custom weights for health score calculation",
            "properties": {
              "availability": {
                "type": "number",
                "title": "Availability Weight",
                "description": "Weight for availability (default: 40)",
                "default": 40,
                "minimum": 0
              },
              "performance": {
                "type": "number",
                "title": "Performance Weight",
                "description": "Weight for performance (default: 30)",
                "default": 30,
                "minimum": 0
              },
              "validation": {
                "type": "number",
                "title": "Validation Weight",
                "description": "Weight for validation (default: 20)",
                "default": 20,
                "minimum": 0
              },
              "reliability": {
                "type": "number",
                "title": "Reliability Weight",
                "description": "Weight for reliability (default: 10)",
                "default": 10,
                "minimum": 0
              }
            }
          },
          "genaiEndpoints": {
            "title": "GenAI Endpoints",
            "type": "array",
            "description": "List of GenAI/LLM API endpoints to monitor (OpenAI, Anthropic, Google, Azure)",
            "items": {
              "type": "object",
              "required": [
                "name",
                "provider",
                "model",
                "apiKeyEnvVar"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "title": "Name",
                  "description": "Friendly name for this GenAI endpoint"
                },
                "provider": {
                  "type": "string",
                  "title": "Provider",
                  "description": "GenAI provider",
                  "enum": [
                    "openai",
                    "anthropic",
                    "google",
                    "azure",
                    "custom"
                  ],
                  "default": "openai"
                },
                "model": {
                  "type": "string",
                  "title": "Model",
                  "description": "Model identifier (e.g., gpt-4, claude-3-sonnet, gemini-pro)"
                },
                "baseUrl": {
                  "type": "string",
                  "title": "Base URL",
                  "description": "Custom base URL (required for azure/custom providers)"
                },
                "testPrompt": {
                  "type": "string",
                  "title": "Test Prompt",
                  "description": "Simple prompt to test the API",
                  "default": "Hi, respond with a single word."
                },
                "streaming": {
                  "type": "boolean",
                  "title": "Streaming",
                  "description": "Enable streaming response testing",
                  "default": false
                },
                "maxTokens": {
                  "type": "integer",
                  "title": "Max Tokens",
                  "description": "Maximum tokens for test request",
                  "default": 50,
                  "minimum": 1,
                  "maximum": 1000
                },
                "apiKeyEnvVar": {
                  "type": "string",
                  "title": "API Key Env Var",
                  "description": "Environment variable containing the API key (e.g., OPENAI_API_KEY)"
                },
                "timeoutMs": {
                  "type": "integer",
                  "title": "Timeout (ms)",
                  "description": "Request timeout in milliseconds",
                  "default": 30000,
                  "minimum": 1000,
                  "maximum": 120000
                },
                "maxLatencyMs": {
                  "type": "integer",
                  "title": "Max Latency (ms)",
                  "description": "Maximum acceptable response latency",
                  "default": 5000,
                  "minimum": 100
                },
                "maxTTFTMs": {
                  "type": "integer",
                  "title": "Max TTFT (ms)",
                  "description": "Maximum acceptable time-to-first-token (streaming)",
                  "default": 2000,
                  "minimum": 100
                }
              }
            }
          },
          "genaiThresholds": {
            "title": "GenAI Thresholds",
            "type": "object",
            "description": "Performance thresholds for GenAI endpoints",
            "properties": {
              "fastTTFTMs": {
                "type": "integer",
                "title": "Fast TTFT (ms)",
                "description": "Time-to-first-token below this is rated 'fast'",
                "default": 500,
                "minimum": 1
              },
              "acceptableTTFTMs": {
                "type": "integer",
                "title": "Acceptable TTFT (ms)",
                "description": "Time-to-first-token below this is rated 'acceptable'",
                "default": 2000,
                "minimum": 1
              },
              "tokenBudgetWarning": {
                "type": "integer",
                "title": "Token Budget Warning",
                "description": "Warn when tokens exceed this threshold",
                "default": 1000,
                "minimum": 1
              }
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}